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cy5oIgorCisjZGVmaW5lIF9DT01QT05FTlQgICAgICAgICAgQUNQSV9UT09MUworQUNQSV9NT0RVTEVfTkFNRSgiY21mc2l6ZSIpCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGNtX2dldF9maWxlX3NpemUKKyAqCisgKiBQQVJBTUVURVJTOiAgZmlsZSAgICAgICAgICAgICAgICAgICAgLSBPcGVuIGZpbGUgZGVzY3JpcHRvcgorICoKKyAqIFJFVFVSTjogICAgICBGaWxlIFNpemUuIE9uIGVycm9yLCAtMSAoQUNQSV9VSU5UMzJfTUFYKQorICoKKyAqIERFU0NSSVBUSU9OOiBHZXQgdGhlIHNpemUgb2YgYSBmaWxlLiBVc2VzIHNlZWstdG8tRU9GLiBGaWxlIG11c3QgYmUgb3Blbi4KKyAqICAgICAgICAgICAgICBEb2VzIG5vdCBkaXN0dXJiIHRoZSBjdXJyZW50IGZpbGUgcG9pbnRlci4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwordTMyIGNtX2dldF9maWxlX3NpemUoQUNQSV9GSUxFIGZpbGUpCit7CisJbG9uZyBmaWxlX3NpemU7CisJbG9uZyBjdXJyZW50X29mZnNldDsKKwlhY3BpX3N0YXR1cyBzdGF0dXM7CisKKwkvKiBTYXZlIHRoZSBjdXJyZW50IGZpbGUgcG9pbnRlciwgc2VlayB0byBFT0YgdG8gb2J0YWluIGZpbGUgc2l6ZSAqLworCisJY3VycmVudF9vZmZzZXQgPSBmdGVsbChmaWxlKTsKKwlpZiAoY3VycmVudF9vZmZzZXQgPCAwKSB7CisJCWdvdG8gb2Zmc2V0X2Vycm9yOworCX0KKworCXN0YXR1cyA9IGZzZWVrKGZpbGUsIDAsIFNFRUtfRU5EKTsKKwlpZ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gYmFkY2hhcikgXAorCWlmIChhY3BpX2dibF9vcHRlcnIpIHtmcHJpbnRmIChzdGRlcnIsICIlcyVjXG4iLCBtc2csIGJhZGNoYXIpO30KKworaW50IGFjcGlfZ2JsX29wdGVyciA9IDE7CitpbnQgYWNwaV9nYmxfb3B0aW5kID0gMTsKK2ludCBhY3BpX2dibF9zdWJfb3B0X2NoYXIgPSAwOworY2hhciAqYWNwaV9nYmxfb3B0YXJnOworCitzdGF0aWMgaW50IGN1cnJlbnRfY2hhcl9wdHIgPSAxOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX2dldG9wdF9hcmd1bWVudAorICoKKyAqIFBBUkFNRVRFUlM6ICBhcmdjLCBhcmd2ICAgICAgICAgIC0gZnJvbSBtYWluCisgKgorICogUkVUVVJOOiAgICAgIDAgaWYgYW4gYXJndW1lbnQgd2FzIGZvdW5kLCAtMSBvdGhlcndpc2UuIFNldHMgYWNwaV9nYmxfT3B0YXJnCisgKiAgICAgICAgICAgICAgdG8gcG9pbnQgdG8gdGhlIG5leHQgYXJndW1lbnQuCisgKgorICogREVTQ1JJUFRJT046IEdldCB0aGUgbmV4dCBhcmd1bWVudC4gVXNlZCB0byBvYnRhaW4gYXJndW1lbnRzIGZvciB0aGUKKyAqICAgICAgICAgICAgICB0d28tY2hhcmFjdGVyIG9wdGlvbnMgYWZ0ZXIgdGhlIG9yaWdpbmFsIGNhbGwgdG8gYWNwaV9nZXRvcHQuCisgKiAgICAgICAgICAgICAgTm90ZTogRWl0aGVyIHRoZSBhcmd1bWVudCBzdGFydHMgYXQgdGhlIG5leHQgY2hhcmFjdGVyIGFmdGVyCisgKiAgICAgICAgICAgICAgdGhlIG9wdGlvbiwgb3IgaXQgaXMgcG9pbnRlZCB0byBieSB0aGUgbmV4dCBhcmd2IGVudHJ5LgorICogICAgICAgICAgICAgIChBZnRlciBjYWxsIHRvIGFjcGlfZ2V0b3B0LCB3ZSBuZWVkIHRvIGJhY2t1cCB0byB0aGUgcHJldmlvdXMKKyAqICAgICAgICAgICAgICBhcmd2IGVudHJ5KS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitpbnQgYWNwaV9nZXRvcHRfYXJndW1lbnQoaW50IGFyZ2MsIGNoYXIgKiphcmd2KQoreworCisJYWNwaV9nYmxfb3B0aW5kLS07CisJY3VycmVudF9jaGFyX3B0cisrOworCisJaWYgKGFyZ3ZbYWNwaV9nYmxfb3B0aW5kXVsoaW50KShjdXJyZW50X2NoYXJfcHRyICsgMSldICE9ICdcMCcpIHsKKwkJYWNwaV9nYmxfb3B0YXJnID0KKwkJICAgICZhcmd2W2FjcGlfZ2JsX29wdGluZCsrXVsoaW50KShjdXJyZW50X2NoYXJfcHRyICsgMSldOworCX0gZWxzZSBpZiAoKythY3BpX2dibF9vcHRpbmQgPj0gYXJnYykgeworCQlBQ1BJX09QVElPTl9FUlJPUigiXG5PcHRpb24gcmVxdWlyZXMgYW4gYXJndW1lbnQiLCAwKTsKKworCQljdXJyZW50X2NoYXJfcHRyID0gMTsKKwkJcmV0dXJuICgtMSk7CisJfSBlbHNlIHsKKwkJYWNwaV9nYmxfb3B0YXJnID0gYXJndlthY3BpX2dibF9vcHRpbmQrK107CisJfQorCisJY3VycmVudF9jaGFyX3B0ciA9IDE7CisJcmV0dXJuICgwKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9nZXRvcHQKKyAqCisgKiBQQVJBTUVURVJTOiAgYXJnYywgYXJndiAgICAgICAgICAtIGZyb20gbWFpbgorICogICAgICAgICAgICAgIG9wdHMgICA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JvYiBNb29yZSA8cm9iZXJ0Lm1vb3JlQGludGVsLmNvbT4KKyBMdiBaaGVuZyA8bHYuemhlbmdAaW50ZWwuY29tPgorCisuU0ggU0VFIEFMU08KK1wmXGZJYWNwaXh0cmFjdFxmUlx8KDgpLCBcZklpYXNsXGZSXHwoOCkuCisKKy5TSCBDT1BZUklHSFQKK0NPUFlSSUdIVCAoYykgMjAxMywgSW50ZWwgQ29ycG9yYXRpb24uCmRpZmYgLS1naXQgYS9zcmMva2VybmVsL2xpbnV4L3Y0LjE0L3Rvb2xzL3Bvd2VyL2FjcGkvb3Nfc3BlY2lmaWMvc2VydmljZV9sYXllcnMvb3NsaW51eHRibC5jIGIvc3JjL2tlcm5lbC9saW51eC92NC4xNC90b29scy9wb3dlci9hY3BpL29zX3NwZWNpZmljL3NlcnZpY2VfbGF5ZXJzL29zbGludXh0YmwuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41MmEzOWVjCi0tLSAvZGV2L251bGwKKysrIGIvc3JjL2tlcm5lbC9saW51eC92NC4xNC90b29scy9wb3dlci9hY3BpL29zX3NwZWNpZmljL3NlcnZpY2VfbGF5ZXJzL29zbGludXh0YmwuYwpAQCAtMCwwICsxLDE0MDYgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBNb2R1bGUgTmFtZTogb3NsaW51eHRibCAtIExpbnV4IE9TTCBmb3Igb2J0YWluaW5nIEFDUEkgdGFibGVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNywgSW50ZWwgQ29ycC4KKyAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKgorICogUmVkaXN0cmlidXRpb24gYW5kIH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lc3NlcyAqLworCithY3BpX3BoeXNpY2FsX2FkZHJlc3MgZ2JsX2ZhZHRfYWRkcmVzcyA9IDA7CithY3BpX3BoeXNpY2FsX2FkZHJlc3MgZ2JsX3JzZHBfYWRkcmVzcyA9IDA7CisKKy8qIFJldmlzaW9uIG9mIFJTRCBQVFIgKi8KKwordTggZ2JsX3JldmlzaW9uID0gMDsKKworc3RydWN0IG9zbF90YWJsZV9pbmZvICpnYmxfdGFibGVfbGlzdF9oZWFkID0gTlVMTDsKK3UzMiBnYmxfdGFibGVfY291bnQgPSAwOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIG9zbF9nZXRfbGFzdF9zdGF0dXMKKyAqCisgKiBQQVJBTUVURVJTOiAgZGVmYXVsdF9zdGF0dXMgIC0gRGVmYXVsdCBlcnJvciBzdGF0dXMgdG8gcmV0dXJuCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgQ29udmVydGVkIGZyb20gZXJybm8uCisgKgorICogREVTQ1JJUFRJT046IEdldCBsYXN0IGVycm5vIGFuZCBjb252ZXIgaXQgdG8gYWNwaV9zdGF0dXMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgYWNwaV9zdGF0dXMgb3NsX2dldF9sYXN0X3N0YXR1cyhhY3BpX3N0YXR1cyBkZWZhdWx0X3N0YXR1cykKK3sKKworCXN3aXRjaCAoZXJybm8pIHsKKwljYXNlIEVBQ0NFUzoKKwljYXNlIEVQRVJNOgorCisJCXJldHVybiAoQUVfQUNDRVNTKTsKKworCWNhc2UgRU5PRU5UOgorCisJCXJldHVybiAoQUVfTk9UX0ZPVU5EKTsKKworCWNhc2UgRU5PTUVNOgorCisJCXJldHVybiAoQUVfTk9fTUVNT1JZKTsKKworCWRlZmF1bHQ6CisKKwkJcmV0dXJuIChkZWZhdWx0X3N0YXR1cyk7CisJfQorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfZ2V0X3RhYmxlX2J5X2FkZHJlc3MKKyAqCisgKiBQQVJBTUVURVJTOiAgYWRkcmVzcyAgICAgICAgIC0gUGh5c2ljYWwgYWRkcmVzcyBvZiB0aGUgQUNQSSB0YWJsZQorICogICAgICAgICAgICAgIHRhYmxlICAgICAgICAgICAtIFdoZXJlIGEgcG9pbnRlciB0byB0aGUgdGFibGUgaXMgcmV0dXJuZWQKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzOyBUYWJsZSBidWZmZXIgaXMgcmV0dXJuZWQgaWYgQUVfT0suCisgKiAgICAgICAgICAgICAgQUVfTk9UX0ZPVU5EOiBBIHZhbGlkIHRhYmxlIHdhcyBub3QgZm91bmQgYXQgdGhlIGFkZHJlc3MKKyAqCisgKiBERVNDUklQVElPTjogR2V0IGFuIEFDUEkgdGFibGUgdmlhIGEgcGh5c2ljYWwgbWVtb3J5IGFkZHJlc3MuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19nZXRfdGFibGVfYnlfYWRkcmVzcyhhY3BpX3BoeXNpY2FsX2FkZHJlc3MgYWRkcmVzcywKKwkJCSAgICAgc3RydWN0IGFjcGlfdGFibGVfaGVhZGVyICoqdGFibGUpCit7CisJdTMyIHRhYmxlX2xlbmd0aDsKKwlzdHJ1Y3QgYWNwaV90YWJsZV9oZWFkZXIgKm1hcHBlZF90YWJsZTsKKwlzdHJ1Y3QgYWNwaV90YWJsZV9oZWFkZXIgKmxvY2FsX3RhYmxlID0gTlVMTDsKKwlhY3BpX3N0YXR1cyBzdGF0dXMgPSBBRV9PSzsKKworCS8qIEdldCBtYWluIEFDUEkgdGFibGVzIGZyb20gbWVtb3J5IG9uIGZpcnN0IGludm9jYXRpb24gb2YgdGhpcyBmdW5jdGlvbiAqLworCisJc3RhdHVzID0gb3NsX3RhYmxlX2luaXRpYWxpemUoKTsKKwlpZiAoQUNQSV9GQUlMVVJFKHN0YXR1cykpIHsKKwkJcmV0dXJuIChzdGF0dXMpOworCX0KKworCS8qIE1hcCB0aGUgdGFibGUgYW5kIHZhbGlkYXRlIGl0ICovCisKKwlzdGF0dXMgPSBvc2xfbWFwX3RhYmxlKGFkZHJlc3MsIE5VTEwsICZtYXBwZWRfdGFibGUpOworCWlmIChBQ1BJX0ZBSUxVUkUoc3RhdHVzKSkgeworCQlyZXR1cm4gKHN0YXR1cyk7CisJfQorCisJLyogQ29weSB0YWJsZSB0byBsb2NhbCBidWZmZXIgYW5kIHJldHVybiBpdCAqLworCisJdGFibGVfbGVuZ3RoID0gYXBfZ2V0X3RhYmxlX2xlbmd0aChtYXBwZWRfdGFibGUpOworCWlmICh0YWJsZV9sZW5ndGggPT0gMCkgeworCQlzdGF0dXMgPSBBRV9CQURfSEVBREVSOworCQlnb3RvIGV4aXQ7CisJfQorCisJbG9jYWxfdGFibGUgPSBjYWxsb2MoMSwgdGFibGVfbGVuZ3RoKTsKKwlpZiAoIWxvY2FsX3RhYmxlKSB7CisJCXN0YXR1cyA9IEFFX05PX01FTU9SWTsKKwkJZ290byBleGl0OworCX0KKworCW1lbWNweShsb2NhbF90YWJsZSwgbWFwcGVkX3RhYmxlLCB0YWJsZV9sZW5ndGgpOworCitleGl0OgorCW9zbF91bm1hcF90YWJsZShtYXBwZWRfdGFibGUpOworCSp0YWJsZSA9IGxvY2FsX3RhYmxlOworCXJldHVybiAoc3RhdHVzKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2dldF90YWJsZV9ieV9uYW1lCisgKgorICogUEFSQU1FVEVSUzogIHNpZ25hdHVyZSAgICAgICAtIEFDUEkgU2lnbmF0dXJlIGZvciBkZXNpcmVkIHRhYmxlLiBNdXN0IGJlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSBudWxsIHRlcm1pbmF0ZWQgNC1jaGFyYWN0ZXIgc3RyaW5nLgorICogICAgICAgICAgICAgIGluc3RhbmNlICAgICAgICAtIE11bHRpcGxlIHRhYmxlIHN1cHBvcnQgZm9yIFNTRFQvVUVGSSAoMC4uLm4pCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXVzdCBiZSAwIGZvciBvdGhlciB0YWJsZXMuCisgKiAgICAgICAgICAgICAgdGFibGUgICAgICAgICAgIC0gV2hlcmUgYSBwb2ludGVyIHRvIHRoZSB0YWJsZSBpcyByZXR1cm5lZAorICogICAgICAgICAgICAgIGFkZHJlc3MgICAgICAgICAtIFdoZXJlIHRoZSB0YWJsZSBwaHlzaWNhbCBhZGRyZXNzIGlzIHJldHVybmVkCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgVGFibGUgYnVmZmVyIGFuZCBwaHlzaWNhbCBhZGRyZXNzIHJldHVybmVkIGlmIEFFX09LLgorICogICAgICAgICAgICAgIEFFX0xJTUlUOiBJbnN0YW5jZSBpcyBiZXlvbmQgdmFsaWQgbGltaXQKKyAqICAgICAgICAgICAgICBBRV9OT1RfRk9VTkQ6IEEgdGFibGUgd2l0aCB0aGUgc2lnbmF0dXJlIHdhcyBub3QgZm91bmQKKyAqCisgKiBOT1RFOiAgICAgICAgQXNzdW1lcyB0aGUgaW5wdXQgc2lnbmF0dXJlIGlzIHVwcGVyY2FzZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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YXR1cyA9PSBBRV9MSU1JVCkgeworCQlpZiAoZ2JsX2R1bXBfZHluYW1pY190YWJsZXMpIHsKKworCQkJLyogQXR0ZW1wdCB0byBnZXQgYSBkeW5hbWljIHRhYmxlICovCisKKwkJCXN0YXR1cyA9CisJCQkgICAgb3NsX2dldF9jdXN0b21pemVkX3RhYmxlKERZTkFNSUNfVEFCTEVfRElSLAorCQkJCQkJICAgICBzaWduYXR1cmUsIGluc3RhbmNlLCB0YWJsZSwKKwkJCQkJCSAgICAgYWRkcmVzcyk7CisJCX0KKwl9CisKKwlyZXR1cm4gKHN0YXR1cyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgb3NsX2FkZF90YWJsZV90b19saXN0CisgKgorICogUEFSQU1FVEVSUzogIHNpZ25hdHVyZSAgICAgICAtIFRhYmxlIHNpZ25hdHVyZQorICogICAgICAgICAgICAgIGluc3RhbmNlICAgICAgICAtIFRhYmxlIGluc3RhbmNlCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgU3VjY2Vzc2Z1bGx5IGFkZGVkIGlmIEFFX09LLgorICogICAgICAgICAgICAgIEFFX05PX01FTU9SWTogTWVtb3J5IGFsbG9jYXRpb24gZXJyb3IKKyAqCisgKiBERVNDUklQVElPTjogSW5zZXJ0IGEgdGFibGUgc3RydWN0dXJlIGludG8gT1NMIHRhYmxlIGxpc3QuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgYWNwaV9zdGF0dXMgb3NsX2FkZF90YWJsZV90b19saXN0KGNoYXIgKnNpZ25hdHVyZSwgdTMyIGluc3RhbmNlKQoreworCXN0cnVjdCBvc2xfdGFibGVfaW5mbyAqbmV3X2luZm87CisJc3RydWN0IG9z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c3RhbmNlKTsKKwkJfQorCQlpbnN0YW5jZSA9IG5leHRfaW5zdGFuY2U7CisJfQorCisJbmV3X2luZm8tPmluc3RhbmNlID0gaW5zdGFuY2U7CisJZ2JsX3RhYmxlX2NvdW50Kys7CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2dldF90YWJsZV9ieV9pbmRleAorICoKKyAqIFBBUkFNRVRFUlM6ICBpbmRleCAgICAgICAgICAgLSBXaGljaCB0YWJsZSB0byBnZXQKKyAqICAgICAgICAgICAgICB0YWJsZSAgICAgICAgICAgLSBXaGVyZSBhIHBvaW50ZXIgdG8gdGhlIHRhYmxlIGlzIHJldHVybmVkCisgKiAgICAgICAgICAgICAgaW5zdGFuY2UgICAgICAgIC0gV2hlcmUgYSBwb2ludGVyIHRvIHRoZSB0YWJsZSBpbnN0YW5jZSBuby4gaXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm5lZAorICogICAgICAgICAgICAgIGFkZHJlc3MgICAgICAgICAtIFdoZXJlIHRoZSB0YWJsZSBwaHlzaWNhbCBhZGRyZXNzIGlzIHJldHVybmVkCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgVGFibGUgYnVmZmVyIGFuZCBwaHlzaWNhbCBhZGRyZXNzIHJldHVybmVkIGlmIEFFX09LLgorICogICAgICAgICAgICAgIEFFX0xJTUlUOiBJbmRleCBpcyBiZXlvbmQgdmFsaWQgbGltaXQKKyAqCisgKiBERVNDUklQVElPTjogR2V0IGFuIEFDUEkgdGFibGUgdmlhIGFuIGluZGV4IHZhbHVlICgwIHRocm91Z2ggbikuIFJldHVybnMKKyAqICAgICAgICAgICAgICBBRV9MSU1JVCB3aGVuIGFuIGludmFsaWQgaW5kZXggaXMgcmVhY2hl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dGhlIHNpZ25hdHVyZSAqLworCisJc3RhdHVzID0gYWNwaV9vc19nZXRfdGFibGVfYnlfbmFtZShpbmZvLT5zaWduYXR1cmUsIGluZm8tPmluc3RhbmNlLAorCQkJCQkgICB0YWJsZSwgYWRkcmVzcyk7CisKKwlpZiAoQUNQSV9TVUNDRVNTKHN0YXR1cykpIHsKKwkJKmluc3RhbmNlID0gaW5mby0+aW5zdGFuY2U7CisJfQorCXJldHVybiAoc3RhdHVzKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfZmluZF9yc2RwX3ZpYV9lZmlfYnlfa2V5d29yZAorICoKKyAqIFBBUkFNRVRFUlM6ICBrZXl3b3JkICAgICAgICAgLSBDaGFyYWN0ZXIgc3RyaW5nIGluZGljYXRpbmcgQUNQSSBHVUlEIHZlcnNpb24KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgRUZJIHRhYmxlCisgKgorICogUkVUVVJOOiAgICAgIFJTRFAgYWRkcmVzcyBpZiBmb3VuZAorICoKKyAqIERFU0NSSVBUSU9OOiBGaW5kIFJTRFAgYWRkcmVzcyB2aWEgRUZJIHVzaW5nIGtleXdvcmQgaW5kaWNhdGluZyB0aGUgQUNQSQorICogICAgICAgICAgICAgIEdVSUQgdmVyc2lvbi4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3BoeXNpY2FsX2FkZHJlc3MKK29zbF9maW5kX3JzZHBfdmlhX2VmaV9ieV9rZXl3b3JkKEZJTEUgKiBmaWxlLCBjb25zdCBjaGFyICprZXl3b3JkKQoreworCWNoYXIgYnVmZmVyWzgwXTsKKwl1bnNpZ25lZCBsb25nIGxvbmcgYWRkcmVzcyA9IDA7CisJY2hhciBmb3JtYXRbMzJdOworCisJc25wcmludGYoZm9ybWF0LCAzMiwgIiVzPSVzIiwga2V5d29yZCwgIiVsbHgiKTsKKwlmc2VlayhmaWxlLCAwLCBTRUVLX1NFVCk7CisJd2hpbGUgKGZnZXRzKGJ1ZmZlciwgODAsIGZpbGUpKSB7CisJCWlmIChzc2NhbmYoYnVmZmVyLCBmb3JtYXQsICZhZGRyZXNzKSA9PSAxKSB7CisJCQlicmVhazsKKwkJfQorCX0KKworCXJldHVybiAoKGFjcGlfcGh5c2ljYWxfYWRkcmVzcykoYWRkcmVzcykpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIG9zbF9maW5kX3JzZHBfdmlhX2VmaQorICoKKyAqIFBBUkFNRVRFUlM6ICBOb25lCisgKgorICogUkVUVVJOOiAgICAgIFJTRFAgYWRkcmVzcyBpZiBmb3VuZAorICoKKyAqIERFU0NSSVBUSU9OOiBGaW5kIFJTRFAgYWRkcmVzcyB2aWEgRUZJLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGFjcGlfcGh5c2ljYWxfYWRkcmVzcyBvc2xfZmluZF9yc2RwX3ZpYV9lZmkodm9pZCkKK3sKKwlGSUxFICpmaWxlOworCWFjcGlfcGh5c2ljYWxfYWRkcmVzcyBhZGRyZXNzID0gMDsKKworCWZpbGUgPSBmb3BlbihFRklfU1lTVEFCLCAiciIpOworCWlmIChmaWxlKSB7CisJCWFkZHJlc3MgPSBvc2xfZmluZF9yc2RwX3ZpYV9lZmlfYnlfa2V5d29yZChmaWxlLCAiQUNQSTIwIik7CisJCWlmICghYWRkcmVzcykgeworCQkJYWRkcmVzcyA9CisJCQkgICAgb3NsX2ZpbmRfcnNkcF92aWFfZWZpX2J5X2tleXdvcmQoZmlsZSwgIkFDUEkiKTsKKwkJfQorCQlmY2xvc2UoZmlsZSk7CisJfQorCisJcmV0dXJuIChhZGRyZXNzKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfbG9hZF9yc2RwCisgKgorICogUEFSQU1FVEVSUzogIE5vbmUKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IFNjYW4gYW5kIGxvYWQgUlNEUC4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cyBvc2xfbG9hZF9yc2RwKHZvaWQpCit7CisJc3RydWN0IGFjcGlfdGFibGVfaGVhZGVyICptYXBwZWRfdGFibGU7CisJdTggKnJzZHBfYWRkcmVzczsKKwlhY3BpX3BoeXNpY2FsX2FkZHJlc3MgcnNkcF9iYXNlOworCWFjcGlfc2l6ZSByc2RwX3NpemU7CisKKwkvKiBHZXQgUlNEUCBmcm9tIG1lbW9yeSAqLworCisJcnNkcF9zaXplID0gc2l6ZW9mKHN0cnVjdCBhY3BpX3RhYmxlX3JzZHApOworCWlmIChnYmxfcnNkcF9iYXNlKSB7CisJCXJzZHBfYmFzZSA9IGdibF9yc2RwX2Jhc2U7CisJfSBlbHNlIHsKKwkJcnNkcF9iYXNlID0gb3NsX2ZpbmRfcnNkcF92aWFfZWZpKCk7CisJfQorCisJaWYgKCFyc2RwX2Jhc2UpIHsKKwkJcnNkcF9iYXNlID0gQUNQSV9ISV9SU0RQX1dJTkRPV19CQVNFOworCQlyc2RwX3NpemUgPSBBQ1BJX0hJX1JTRFBfV0lORE9XX1NJWkU7CisJ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ZSB1c2VkLgorICoKKyAqIERFU0NSSVBUSU9OOiBUaGlzIGZ1bmN0aW9uIGNvbGxlY3RzIGxvZ2ljIHRoYXQgY2FuIGJlIHVzZWQgdG8gZGV0ZXJtaW5lIGlmCisgKiAgICAgICAgICAgICAgWFNEVCBzaG91bGQgYmUgdXNlZCBpbnN0ZWFkIG9mIFJTRFQuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdTggb3NsX2Nhbl91c2VfeHNkdCh2b2lkKQoreworCWlmIChnYmxfcmV2aXNpb24gJiYgIWFjcGlfZ2JsX2RvX25vdF91c2VfeHNkdCkgeworCQlyZXR1cm4gKFRSVUUpOworCX0gZWxzZSB7CisJCXJldHVybiAoRkFMU0UpOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfdGFibGVfaW5pdGlhbGl6ZQorICoKKyAqIFBBUkFNRVRFUlM6ICBOb25lCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cworICoKKyAqIERFU0NSSVBUSU9OOiBJbml0aWFsaXplIEFDUEkgdGFibGUgZGF0YS4gR2V0IGFuZCBzdG9yZSBtYWluIEFDUEkgdGFibGVzIHRvCisgKiAgICAgICAgICAgICAgbG9jYWwgdmFyaWFibGVzLiBNYWluIEFDUEkgdGFibGVzIGluY2x1ZGUgUlNEVCwgRkFEVCwgUlNEVCwKKyAqICAgICAgICAgICAgICBhbmQvb3IgWFNEVC4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cyBvc2xfdGFibGVfaW5pdGlhbGl6ZSh2b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WJsZXMgaW4gdGhlIGR5bmFtaWMgZGlyZWN0b3J5ICovCisKKwkJc3RhdHVzID0gb3NsX2xpc3RfY3VzdG9taXplZF90YWJsZXMoRFlOQU1JQ19UQUJMRV9ESVIpOworCQlpZiAoQUNQSV9GQUlMVVJFKHN0YXR1cykpIHsKKwkJCXJldHVybiAoc3RhdHVzKTsKKwkJfQorCX0KKworCWdibF90YWJsZV9saXN0X2luaXRpYWxpemVkID0gVFJVRTsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfbGlzdF9iaW9zX3RhYmxlcworICoKKyAqIFBBUkFNRVRFUlM6ICBOb25lCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgVGFibGUgbGlzdCBpcyBpbml0aWFsaXplZCBpZiBBRV9PSy4KKyAqCisgKiBERVNDUklQVElPTjogQWRkIEFDUEkgdGFibGVzIHRvIHRoZSB0YWJsZSBsaXN0IGZyb20gbWVtb3J5LgorICoKKyAqIE5PVEU6ICAgICAgICBUaGlzIHdvcmtzIG9uIExpbnV4IGFzIHRhYmxlIGN1c3RvbWl6YXRpb24gZG9lcyBub3QgbW9kaWZ5IHRoZQorICogICAgICAgICAgICAgIGFkZHJlc3NlcyBzdG9yZWQgaW4gUlNEUC9SU0RUL1hTRFQvRkFEVC4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cyBvc2xfbGlzdF9iaW9zX3RhYmxlcyh2b2lkKQoreworCXN0cnVjdCBhY3BpX3RhYmxlX2hlYWRlciAqbWFwcGVkX3RhYmxlID0gTlVMTDsKKwl1OCAqdGFibGVfZGF0YTsKKwl1OCBudW1iZXJfb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FibGVfYWRkcmVzcyA9CisJCQkgICAgKGFjcGlfcGh5c2ljYWxfYWRkcmVzcykoKkFDUElfQ0FTVDY0KHRhYmxlX2RhdGEpKTsKKwkJfSBlbHNlIHsKKwkJCXRhYmxlX2FkZHJlc3MgPQorCQkJICAgIChhY3BpX3BoeXNpY2FsX2FkZHJlc3MpKCpBQ1BJX0NBU1QzMih0YWJsZV9kYXRhKSk7CisJCX0KKworCQkvKiBTa2lwIE5VTEwgZW50cmllcyBpbiBSU0RUL1hTRFQgKi8KKworCQlpZiAodGFibGVfYWRkcmVzcyA9PSAwKSB7CisJCQljb250aW51ZTsKKwkJfQorCisJCXN0YXR1cyA9IG9zbF9tYXBfdGFibGUodGFibGVfYWRkcmVzcywgTlVMTCwgJm1hcHBlZF90YWJsZSk7CisJCWlmIChBQ1BJX0ZBSUxVUkUoc3RhdHVzKSkgeworCQkJcmV0dXJuIChzdGF0dXMpOworCQl9CisKKwkJb3NsX2FkZF90YWJsZV90b19saXN0KG1hcHBlZF90YWJsZS0+c2lnbmF0dXJlLCAwKTsKKwkJb3NsX3VubWFwX3RhYmxlKG1hcHBlZF90YWJsZSk7CisJfQorCisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgb3NsX2dldF9iaW9zX3RhYmxlCisgKgorICogUEFSQU1FVEVSUzogIHNpZ25hdHVyZSAgICAgICAtIEFDUEkgU2lnbmF0dXJlIGZvciBjb21tb24gdGFibGUuIE11c3QgYmUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIG51bGwgdGVybWluYXRlZCA0LWNoYXJhY3RlciBzdHJpbmcuCisgKiAgICAgICAgICAgICAgaW5zdGFuY2UgICAgICAgIC0gTXVsdGlwbGUgdGFibGUgc3VwcG9ydCBmb3IgU1NEVC9VRUZJICgwLi4ubikKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdXN0IGJlIDAgZm9yIG90aGVyIHRhYmxlcy4KKyAqICAgICAgICAgICAgICB0YWJsZSAgICAgICAgICAgLSBXaGVyZSBhIHBvaW50ZXIgdG8gdGhlIHRhYmxlIGlzIHJldHVybmVkCisgKiAgICAgICAgICAgICAgYWRkcmVzcyAgICAgICAgIC0gV2hlcmUgdGhlIHRhYmxlIHBoeXNpY2FsIGFkZHJlc3MgaXMgcmV0dXJuZWQKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzOyBUYWJsZSBidWZmZXIgYW5kIHBoeXNpY2FsIGFkZHJlc3MgcmV0dXJuZWQgaWYgQUVfT0suCisgKiAgICAgICAgICAgICAgQUVfTElNSVQ6IEluc3RhbmNlIGlzIGJleW9uZCB2YWxpZCBsaW1pdAorICogICAgICAgICAgICAgIEFFX05PVF9GT1VORDogQSB0YWJsZSB3aXRoIHRoZSBzaWduYXR1cmUgd2FzIG5vdCBmb3VuZAorICoKKyAqIERFU0NSSVBUSU9OOiBHZXQgYSBCSU9TIHByb3ZpZGVkIEFDUEkgdGFibGUKKyAqCisgKiBOT1RFOiAgICAgICAgQXNzdW1lcyB0aGUgaW5wdXQgc2lnbmF0dXJlIGlzIHVwcGVyY2FzZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cworb3NsX2dldF9iaW9zX3RhYmxlKGNoYXIgKnNpZ25hdHVyZSwKKwkJICAgdTMyIGluc3RhbmNlLAorCQkgICBzdHJ1Y3QgYWNwaV90YWJsZV9oZWFkZXIgKip0YWJsZSwKKwkJICAgYWNwaV9waHlzaWNhbF9hZGRyZXNzICphZGRyZXNzKQoreworCXN0cnVjdCBhY3BpX3RhYmxlX2hlYWRlciAqbG9jYWxfdGFibGUgPSBOVUxMOworCXN0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fQkFEX0hFQURFUjsKKwkJZ290byBleGl0OworCX0KKworCS8qIENvcHkgdGFibGUgdG8gbG9jYWwgYnVmZmVyIGFuZCByZXR1cm4gaXQgKi8KKworCWxvY2FsX3RhYmxlID0gY2FsbG9jKDEsIHRhYmxlX2xlbmd0aCk7CisJaWYgKCFsb2NhbF90YWJsZSkgeworCQlzdGF0dXMgPSBBRV9OT19NRU1PUlk7CisJCWdvdG8gZXhpdDsKKwl9CisKKwltZW1jcHkobG9jYWxfdGFibGUsIG1hcHBlZF90YWJsZSwgdGFibGVfbGVuZ3RoKTsKKwkqYWRkcmVzcyA9IHRhYmxlX2FkZHJlc3M7CisJKnRhYmxlID0gbG9jYWxfdGFibGU7CisKK2V4aXQ6CisJb3NsX3VubWFwX3RhYmxlKG1hcHBlZF90YWJsZSk7CisJcmV0dXJuIChzdGF0dXMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIG9zbF9saXN0X2N1c3RvbWl6ZWRfdGFibGVzCisgKgorICogUEFSQU1FVEVSUzogIGRpcmVjdG9yeSAgICAgICAgICAgLSBEaXJlY3RvcnkgdGhhdCBjb250YWlucyB0aGUgdGFibGVzCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgVGFibGUgbGlzdCBpcyBpbml0aWFsaXplZCBpZiBBRV9PSy4KKyAqCisgKiBERVNDUklQVElPTjogQWRkIEFDUEkgdGFibGVzIHRvIHRoZSB0YWJsZSBsaXN0IGZyb20gYSBkaXJlY3RvcnkuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgYWNwaV9zdGF0dXMgb3NsX2xpc3RfY3VzdG9taXplZF90YWJsZXMoY2hhciAqZGlyZWN0b3J5KQoreworCXZvaWQgKn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uIChzdGF0dXMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIG9zbF9tYXBfdGFibGUKKyAqCisgKiBQQVJBTUVURVJTOiAgYWRkcmVzcyAgICAgICAgICAgICAtIEFkZHJlc3Mgb2YgdGhlIHRhYmxlIGluIG1lbW9yeQorICogICAgICAgICAgICAgIHNpZ25hdHVyZSAgICAgICAgICAgLSBPcHRpb25hbCBBQ1BJIFNpZ25hdHVyZSBmb3IgZGVzaXJlZCB0YWJsZS4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVsbCB0ZXJtaW5hdGVkIDQtY2hhcmFjdGVyIHN0cmluZy4KKyAqICAgICAgICAgICAgICB0YWJsZSAgICAgICAgICAgICAgIC0gV2hlcmUgYSBwb2ludGVyIHRvIHRoZSBtYXBwZWQgdGFibGUgaXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuZWQKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzOyBNYXBwZWQgdGFibGUgaXMgcmV0dXJuZWQgaWYgQUVfT0suCisgKiAgICAgICAgICAgICAgQUVfTk9UX0ZPVU5EOiBBIHZhbGlkIHRhYmxlIHdhcyBub3QgZm91bmQgYXQgdGhlIGFkZHJlc3MKKyAqCisgKiBERVNDUklQVElPTjogTWFwIGVudGlyZSBBQ1BJIHRhYmxlIGludG8gY2FsbGVyJ3MgYWRkcmVzcyBzcGFjZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cworb3NsX21hcF90YWJsZShhY3BpX3NpemUgYWRkcmVzcywKKwkgICAgICBjaGFyICpzaWduYXR1cmUsIHN0cnVjdCBhY3B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X3RhYmxlKTsKKworCSp0YWJsZSA9IG1hcHBlZF90YWJsZTsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfdW5tYXBfdGFibGUKKyAqCisgKiBQQVJBTUVURVJTOiAgdGFibGUgICAgICAgICAgICAgICAtIEEgcG9pbnRlciB0byB0aGUgbWFwcGVkIHRhYmxlCisgKgorICogUkVUVVJOOiAgICAgIE5vbmUKKyAqCisgKiBERVNDUklQVElPTjogVW5tYXAgZW50aXJlIEFDUEkgdGFibGUuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCBvc2xfdW5tYXBfdGFibGUoc3RydWN0IGFjcGlfdGFibGVfaGVhZGVyICp0YWJsZSkKK3sKKwlpZiAodGFibGUpIHsKKwkJYWNwaV9vc191bm1hcF9tZW1vcnkodGFibGUsIGFwX2dldF90YWJsZV9sZW5ndGgodGFibGUpKTsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgb3NsX3RhYmxlX25hbWVfZnJvbV9maWxlCisgKgorICogUEFSQU1FVEVSUzogIGZpbGVuYW1lICAgICAgICAgICAgLSBGaWxlIHRoYXQgY29udGFpbnMgdGhlIGRlc2lyZWQgdGFibGUKKyAqICAgICAgICAgICAgICBzaWduYXR1cmUgICAgICAgICAgIC0gUG9pbnRlciB0byA0LWNoYXJhY3RlciBidWZmZXIgdG8gc3RvcmUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFjdGVkIHRhYmxlIHNpZ25hdHVyZS4KKyAqICAgICAgICAgICAgICBpbnN0YW5jZSAgICAgICAgICAgIC0gUG9pbnRlciB0byBpbnRlZ2VyIHRvIHN0b3JlIGV4dHJhY3RlZAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJsZSBpbnN0YW5jZSBudW1iZXIuCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1czsgVGFibGUgbmFtZSBpcyBleHRyYWN0ZWQgaWYgQUVfT0suCisgKgorICogREVTQ1JJUFRJT046IEV4dHJhY3QgdGFibGUgc2lnbmF0dXJlIGFuZCBpbnN0YW5jZSBudW1iZXIgZnJvbSBhIHRhYmxlIGZpbGUKKyAqICAgICAgICAgICAgICBuYW1lLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGFjcGlfc3RhdHVzCitvc2xfdGFibGVfbmFtZV9mcm9tX2ZpbGUoY2hhciAqZmlsZW5hbWUsIGNoYXIgKnNpZ25hdHVyZSwgdTMyICppbnN0YW5jZSkKK3sKKworCS8qIElnbm9yZSBtZWFuaW5nbGVzcyBmaWxlcyAqLworCisJaWYgKHN0cmxlbihmaWxlbmFtZSkgPCBBQ1BJX05BTUVfU0laRSkgeworCQlyZXR1cm4gKEFFX0JBRF9TSUdOQVRVUkUpOworCX0KKworCS8qIEV4dHJhY3QgaW5zdGFuY2UgbnVtYmVyICovCisKKwlpZiAoaXNkaWdpdCgoaW50KWZpbGVuYW1lW0FDUElfTkFNRV9TSVpFXSkpIHsKKwkJc3NjYW5mKCZmaWxlbmFtZVtBQ1BJX05BTUVfU0laRV0sICIldSIsIGluc3RhbmNlKTsKKwl9IGVsc2UgaWYgKHN0cmxlbihmaWxlbmFtZSkgIT0gQUNQSV9OQU1FX1NJWkUpIHsKKwkJcmV0dXJuIChBRV9CQURfU0lHTkFUVVJFKTsKKwl9IGVsc2UgeworCQkqaW5zdGFuY2UgPSAwOworCX0KKworCS8qIEV4dHJhY3Qgc2lnbmF0dXJlICovCisKKwlBQ1BJX01PVkVfTkFNRShzaWduYXR1cmUsIGZpbGVuYW1lKTsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBvc2xfcmVhZF90YWJsZV9mcm9tX2ZpbGUKKyAqCisgKiBQQVJBTUVURVJTOiAgZmlsZW5hbWUgICAgICAgICAgICAtIEZpbGUgdGhhdCBjb250YWlucyB0aGUgZGVzaXJlZCB0YWJsZQorICogICAgICAgICAgICAgIGZpbGVfb2Zmc2V0ICAgICAgICAgLSBPZmZzZXQgb2YgdGhlIHRhYmxlIGluIGZpbGUKKyAqICAgICAgICAgICAgICBzaWduYXR1cmUgICAgICAgICAgIC0gT3B0aW9uYWwgQUNQSSBTaWduYXR1cmUgZm9yIGRlc2lyZWQgdGFibGUuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEgbnVsbCB0ZXJtaW5hdGVkIDQtY2hhcmFjdGVyIHN0cmluZy4KKyAqICAgICAgICAgICAgICB0YWJsZSAgICAgICAgICAgICAgIC0gV2hlcmUgYSBwb2ludGVyIHRvIHRoZSB0YWJsZSBpcyByZXR1cm5lZAorICoKKyAqIFJFVFVSTjogICAgICBTdGF0dXM7IFRhYmxlIGJ1ZmZlciBpcyByZXR1cm5lZCBpZiBBRV9PSy4KKyAqCisgKiBERVNDUklQVElPTjogUmVhZCBhIEFDUEkgdGFibGUgZnJvbSBhIGZpbGUuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgYWNwaV9zdGF0dXMKK29zbF9yZWFkX3RhYmxlX2Zyb21f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c2lyZWQgdGFibGUuIE11c3QgYmUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIG51bGwgdGVybWluYXRlZCA0LWNoYXJhY3RlciBzdHJpbmcuCisgKiAgICAgICAgICAgICAgaW5zdGFuY2UgICAgICAgIC0gTXVsdGlwbGUgdGFibGUgc3VwcG9ydCBmb3IgU1NEVC9VRUZJICgwLi4ubikKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdXN0IGJlIDAgZm9yIG90aGVyIHRhYmxlcy4KKyAqICAgICAgICAgICAgICB0YWJsZSAgICAgICAgICAgLSBXaGVyZSBhIHBvaW50ZXIgdG8gdGhlIHRhYmxlIGlzIHJldHVybmVkCisgKiAgICAgICAgICAgICAgYWRkcmVzcyAgICAgICAgIC0gV2hlcmUgdGhlIHRhYmxlIHBoeXNpY2FsIGFkZHJlc3MgaXMgcmV0dXJuZWQKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzOyBUYWJsZSBidWZmZXIgaXMgcmV0dXJuZWQgaWYgQUVfT0suCisgKiAgICAgICAgICAgICAgQUVfTElNSVQ6IEluc3RhbmNlIGlzIGJleW9uZCB2YWxpZCBsaW1pdAorICogICAgICAgICAgICAgIEFFX05PVF9GT1VORDogQSB0YWJsZSB3aXRoIHRoZSBzaWduYXR1cmUgd2FzIG5vdCBmb3VuZAorICoKKyAqIERFU0NSSVBUSU9OOiBHZXQgYW4gT1MgY3VzdG9taXplZCB0YWJsZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBhY3BpX3N0YXR1cworb3NsX2dldF9jdXN0b21pemVkX3RhYmxlKGNoYXIgKnBhdGhuYW1lLAorCQkJIGNoYXIgKnNpZ25hdHVyZSwKKwkJCSB1MzIgaW5zdGFuY2UsCisJCQkgc3RydWN0IGFjcGlfdGFibGVfaGVhZGVyICoqdG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Ivc3JjL2tlcm5lbC9saW51eC92NC4xNC90b29scy9wb3dlci9hY3BpL29zX3NwZWNpZmljL3NlcnZpY2VfbGF5ZXJzL29zdW5peGRpci5jCkBAIC0wLDAgKzEsMjA0IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogTW9kdWxlIE5hbWU6IG9zdW5peGRpciAtIFVuaXggZGlyZWN0b3J5IGFjY2VzcyBpbnRlcmZhY2VzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNywgSW50ZWwgQ29ycC4KKyAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKgorICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CisgKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMKKyAqIGFyZSBtZXQ6CisgKiAxLiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodAorICogICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucywgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciwKKyAqICAgIHdpdGhvdXQgbW9kaWZpY2F0aW9uLgorICogMi4gUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIGF0IG1pbmltdW0gYSBkaXNjbGFpbWVyCisgKiAgICBzdWJzdGFudGlhbGx5IHNpbWlsYXIgdG8gdGhlICJOTyBXQVJSQ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JlY3RvcnkKKyAqLwordHlwZWRlZiBzdHJ1Y3QgZXh0ZXJuYWxfZmluZF9pbmZvIHsKKwljaGFyICpkaXJfcGF0aG5hbWU7CisJRElSICpkaXJfcHRyOworCWNoYXIgdGVtcF9idWZmZXJbMjU2XTsKKwljaGFyICp3aWxkY2FyZF9zcGVjOworCWNoYXIgcmVxdWVzdGVkX2ZpbGVfdHlwZTsKKworfSBleHRlcm5hbF9maW5kX2luZm87CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3Nfb3Blbl9kaXJlY3RvcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgZGlyX3BhdGhuYW1lICAgICAgICAtIEZ1bGwgcGF0aG5hbWUgdG8gdGhlIGRpcmVjdG9yeQorICogICAgICAgICAgICAgIHdpbGRjYXJkX3NwZWMgICAgICAgLSBzdHJpbmcgb2YgdGhlIGZvcm0gIiouYyIsIGV0Yy4KKyAqCisgKiBSRVRVUk46ICAgICAgQSBkaXJlY3RvcnkgImhhbmRsZSIgdG8gYmUgdXNlZCBpbiBzdWJzZXF1ZW50IHNlYXJjaCBvcGVyYXRpb25zLgorICogICAgICAgICAgICAgIE5VTEwgcmV0dXJuZWQgb24gZmFpbHVyZS4KKyAqCisgKiBERVNDUklQVElPTjogT3BlbiBhIGRpcmVjdG9yeSBpbiBwcmVwYXJhdGlvbiBmb3IgYSB3aWxkY2FyZCBzZWFyY2gKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkICphY3BpX29zX29wZW5fZGlyZWN0b3J5KGNoYXIgKmRpcl9wYXRobmFtZSwKKwkJCSAgICAgY2hhciAqd2lsZGNhcmRfc3BlYywgY2hhciByZXF1ZXN0ZWRfZmlsZV90eXBl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cmNweShleHRlcm5hbF9pbmZvLT50ZW1wX2J1ZmZlciwKKwkJCQkgICAgICAgZGlyX2VudHJ5LT5kX25hbWUpOworCQkJCXJldHVybiAoZXh0ZXJuYWxfaW5mby0+dGVtcF9idWZmZXIpOworCQkJfQorCQl9CisJfQorCisJcmV0dXJuIChOVUxMKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19jbG9zZV9kaXJlY3RvcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgZGlyX2hhbmRsZSAgICAgICAgICAtIENyZWF0ZWQgdmlhIGFjcGlfb3Nfb3Blbl9kaXJlY3RvcnkKKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZS4KKyAqCisgKiBERVNDUklQVElPTjogQ2xvc2UgdGhlIG9wZW4gZGlyZWN0b3J5IGFuZCBjbGVhbnVwLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgYWNwaV9vc19jbG9zZV9kaXJlY3Rvcnkodm9pZCAqZGlyX2hhbmRsZSkKK3sKKwlzdHJ1Y3QgZXh0ZXJuYWxfZmluZF9pbmZvICpleHRlcm5hbF9pbmZvID0gZGlyX2hhbmRsZTsKKworCS8qIENsb3NlIHRoZSBkaXJlY3RvcnkgYW5kIGZyZWUgYWxsb2NhdGlvbnMgKi8KKworCWNsb3NlZGlyKGV4dGVybmFsX2luZm8tPmRpcl9wdHIpOworCWZyZWUoZGlyX2hhbmRsZSk7Cit9CmRpZmYgLS1naXQgYS9zcmMva2VybmVsL2xpbnV4L3Y0LjE0L3Rvb2xzL3Bvd2VyL2FjcGkvb3Nfc3BlY2lmaWMvc2VydmljZV9sYXllcnMvb3N1bml4bWFwLmMgYi9zcmMva2VybmVsL2xpbnV4L3Y0LjE0L3Rvb2xzL3Bvd2VyL2FjcGkvb3Nfc3BlY2lmaWMvc2VydmljZV9sYXllcnMvb3N1bml4bWFwLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uY2Y5YjVhNQotLS0gL2Rldi9udWxsCisrKyBiL3NyYy9rZXJuZWwvbGludXgvdjQuMTQvdG9vbHMvcG93ZXIvYWNwaS9vc19zcGVjaWZpYy9zZXJ2aWNlX2xheWVycy9vc3VuaXhtYXAuYwpAQCAtMCwwICsxLDE1MSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIE1vZHVsZSBOYW1lOiBvc3VuaXhtYXAgLSBVbml4IE9TTCBmb3IgZmlsZSBtYXBwaW5ncworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyoKKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTcsIEludGVsIENvcnAuCisgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICoKKyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dAorICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zCisgKiBhcmUgbWV0OgorICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHQKKyAqICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMsIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIsCisgKiAgICB3aXRob3V0IG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IDxzeXMvcGFyYW0uaD4KKyNlbmRpZgorCisjZGVmaW5lIF9DT01QT05FTlQgICAgICAgICAgQUNQSV9PU19TRVJWSUNFUworQUNQSV9NT0RVTEVfTkFNRSgib3N1bml4bWFwIikKKworI2lmbmRlZiBPX0JJTkFSWQorI2RlZmluZSBPX0JJTkFSWSAwCisjZW5kaWYKKyNpZiBkZWZpbmVkKF9kcmFnb25fZmx5KSB8fCBkZWZpbmVkKF9mcmVlX0JTRCkgfHwgZGVmaW5lZChfUU5YKQorI2RlZmluZSBNTUFQX0ZMQUdTICAgICAgICAgIE1BUF9TSEFSRUQKKyNlbHNlCisjZGVmaW5lIE1NQVBfRkxBR1MgICAgICAgICAgTUFQX1BSSVZBVEUKKyNlbmRpZgorI2RlZmluZSBTWVNURU1fTUVNT1JZICAgICAgICIvZGV2L21lbSIKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfZ2V0X3BhZ2Vfc2l6ZQorICoKKyAqIFBBUkFNRVRFUlM6ICBOb25lCisgKgorICogUkVUVVJOOiAgICAgIFBhZ2Ugc2l6ZSBvZiB0aGUgcGxhdGZvcm0uCisgKgorICogREVTQ1JJUFRJT046IE9idGFpbiBwYWdlIHNpemUgb2YgdGhlIHBsYXRmb3JtLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgYWNwaV9zaXplIGFjcGlfb3NfZ2V0X3BhZ2Vfc2l6ZSh2b2lkKQoreworCisjaWZkZWYgUEFHRV9TSVpFCisJcmV0dXJuIFBBR0VfU0laRTsKKyNlbHNlCisJcmV0dXJuIHN5c2NvbmYoX1NDX1BBR0VTSVpFKTsKKyNlbmRpZgorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfbWFwX21lbW9yeQorICoKKyAqIFBBUkFNRVRFUlM6ICB3aGVyZSAgICAgICAgICAgICAgIC0gUGh5c2ljYWwgYWRkcmVzcyBvZiBtZW1vcnkgdG8gYmUgbWFwcGVkCisgKiAgICAgICAgICAgICAgbGVuZ3RoICAgICAgICAgICAgICAtIEhvdyBtdWNoIG1lbW9yeSB0byBtYXAKKyAqCisgKiBSRVRVUk46ICAgICAgUG9pbnRlciB0byBtYXBwZWQgbWVtb3J5LiBOdWxsIG9uIGVycm9yLgorICoKKyAqIERFU0NSSVBUSU9OOiBNYXAgcGh5c2ljYWwgbWVtb3J5IGludG8gbG9jYWwgYWRkcmVzcyBzcGFjZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgKmFjcGlfb3NfbWFwX21lbW9yeShhY3BpX3BoeXNpY2FsX2FkZHJlc3Mgd2hlcmUsIGFjcGlfc2l6ZSBsZW5ndGgpCit7CisJdTggKm1hcHBlZF9tZW1vcnk7CisJYWNwaV9waHlzaWNhbF9hZGRyZXNzIG9mZnNldDsKKwlhY3BpX3NpemUgcGFnZV9zaXplOworCWludCBmZDsKKworCWZkID0gb3BlbihTWVNURU1fTUVNT1JZLCBPX1JET05MWSB8IE9fQklOQVJZKTsKKwlpZiAoZmQgPCAwKSB7CisJCWZwcmludGYoc3RkZXJyLCAiQ2Fubm90IG9wZW4gJXNcbiIsIFNZU1RFTV9NRU1PUlkpOworCQlyZXR1cm4gKE5VTEwpOworCX0KKworCS8qIEFsaWduIHRoZSBvZmZzZXQgdG8gdXNlIG1tYXAgKi8KKworCXBhZ2Vfc2l6ZSA9IGFjcGlfb3NfZ2V0X3BhZ2Vfc2l6ZSgpOworCW9mZnNldCA9IHdoZXJlICUgcGFnZV9zaXplOworCisJLyogTWFwIHRoZSB0YWJsZSBoZWFkZXIgdG8gZ2V0IHRoZSBsZW5ndGggb2YgdGhlIGZ1bGwgdGFibGUgKi8KKworCW1hcHBlZF9tZW1vcnkgPSBtbWFwKE5VTEwsIChsZW5ndGggKyBvZmZzZXQpLCBQUk9UX1JFQUQsIE1NQVBfRkxBR1MsCisJCQkgICAgIGZkLCAod2hlcmUgLSBvZmZzZXQpKTsKKwlpZiAobWFwcGVkX21lbW9yeSA9PSBNQVBfRkFJTEVEKSB7CisJCWZwcmludGYoc3RkZXJyLCAiQ2Fubm90IG1hcCAlc1xuIiwgU1lTVEVNX01FTU9SWSk7CisJCWNsb3NlKGZkKTsKKwkJcmV0dXJuIChOVUxMKTsKKwl9CisKKwljbG9zZShmZCk7CisJcmV0dXJuIChBQ1BJX0NBU1Q4KG1hcHBlZF9tZW1vcnkgKyBvZmZzZXQpKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3VubWFwX21lbW9yeQorICoKKyAqIFBBUkFNRVRFUlM6ICB3aGVyZSAgICAgICAgICAgICAgIC0gTG9naWNhbCBhZGRyZXNzIG9mIG1lbW9yeSB0byBiZSB1bm1hcHBlZAorICogICAgICAgICAgICAgIGxlbmd0aCAgICAgICAgICAgICAgLSBIb3cgbXVjaCBtZW1vcnkgdG8gdW5tYXAKKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZS4KKyAqCisgKiBERVNDUklQVElPTjogRGVsZXRlIGEgcHJldmlvdXNseSBjcmVhdGVkIG1hcHBpbmcuIFdoZXJlIGFuZCBMZW5ndGggbXVzdAorICogICAgICAgICAgICAgIGNvcnJlc3BvbmQgdG8gYSBwcmV2aW91cyBtYXBwaW5nIGV4YWN0bHkuCisgKgorICoqKioqKioqKio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sIGF0dHJpYnV0ZXMhXG4iKTsKKwkJcmV0dXJuOworCX0KKworCXRlcm1fYXR0cmlidXRlc193ZXJlX3NldCA9IDE7Cit9CisKK3N0YXRpYyB2b2lkIG9zX2V4aXRfbGluZV9lZGl0X21vZGUodm9pZCkKK3sKKworCWlmICghdGVybV9hdHRyaWJ1dGVzX3dlcmVfc2V0KSB7CisJCXJldHVybjsKKwl9CisKKwkvKiBTZXQgdGVybWluYWwgYXR0cmlidXRlcyBiYWNrIHRvIHRoZSBvcmlnaW5hbCB2YWx1ZXMgKi8KKworCWlmICh0Y3NldGF0dHIoU1RESU5fRklMRU5PLCBUQ1NBTk9XLCAmb3JpZ2luYWxfdGVybV9hdHRyaWJ1dGVzKSkgeworCQlmcHJpbnRmKHN0ZGVyciwgIkNvdWxkIG5vdCByZXN0b3JlIHRlcm1pbmFsIGF0dHJpYnV0ZXMhXG4iKTsKKwl9Cit9CisKKyNlbHNlCisKKy8qIFRoZXNlIGZ1bmN0aW9ucyBhcmUgbm90IG5lZWRlZCBmb3Igb3RoZXIgQUNQSUNBIHV0aWxpdGllcyAqLworCisjZGVmaW5lIG9zX2VudGVyX2xpbmVfZWRpdF9tb2RlKCkKKyNkZWZpbmUgb3NfZXhpdF9saW5lX2VkaXRfbW9kZSgpCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2luaXRpYWxpemUsIGFjcGlfb3NfdGVybWluYXRlCisgKgorICogUEFSQU1FVEVSUzogIE5vbmUKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IEluaXRpYWxpemUgYW5kIHRlcm1pbmF0ZSB0aGlzIG1vZHVsZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzIGFjcGlfb3NfaW5pdGlhbGl6ZSh2b2lkKQoreworCWFjcGlfc3RhdHVzIHN0YXR1czsKKworCWFjcGlfZ2JsX291dHB1dF9maWxlID0gc3Rkb3V0OworCisJb3NfZW50ZXJfbGluZV9lZGl0X21vZGUoKTsKKworCXN0YXR1cyA9IGFjcGlfb3NfY3JlYXRlX2xvY2soJmFjcGlfZ2JsX3ByaW50X2xvY2spOworCWlmIChBQ1BJX0ZBSUxVUkUoc3RhdHVzKSkgeworCQlyZXR1cm4gKHN0YXR1cyk7CisJfQorCisJcmV0dXJuIChBRV9PSyk7Cit9CisKK2FjcGlfc3RhdHVzIGFjcGlfb3NfdGVybWluYXRlKHZvaWQpCit7CisKKwlvc19leGl0X2xpbmVfZWRpdF9tb2RlKCk7CisJcmV0dXJuIChBRV9PSyk7Cit9CisKKyNpZm5kZWYgQUNQSV9VU0VfTkFUSVZFX1JTRFBfUE9JTlRFUgorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2dldF9yb290X3BvaW50ZXIKKyAqCisgKiBQQVJBTUVURVJTOiAgTm9uZQorICoKKyAqIFJFVFVSTjogICAgICBSU0RQIHBoeXNpY2FsIGFkZHJlc3MKKyAqCisgKiBERVNDUklQVElPTjogR2V0cyB0aGUgQUNQSSByb290IHBvaW50ZXIgKFJTRFApCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3BoeXNpY2FsX2FkZHJlc3MgYWNwaV9vc19nZXRfcm9vdF9wb2ludGVyKHZvaWQpCit7CisKKwlyZXR1cm4gKDApOworfQorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19wcmVkZWZpbmVkX292ZXJyaWRlCisgKgorICogUEFSQU1FVEVSUzogIGluaXRfdmFsICAgICAgICAgICAgLSBJbml0aWFsIHZhbHVlIG9mIHRoZSBwcmVkZWZpbmVkIG9iamVjdAorICogICAgICAgICAgICAgIG5ld192YWwgICAgICAgICAgICAgLSBUaGUgbmV3IHZhbHVlIGZvciB0aGUgb2JqZWN0CisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cywgcG9pbnRlciB0byB2YWx1ZS4gTnVsbCBwb2ludGVyIHJldHVybmVkIGlmIG5vdAorICogICAgICAgICAgICAgIG92ZXJyaWRpbmcuCisgKgorICogREVTQ1JJUFRJT046IEFsbG93IHRoZSBPUyB0byBvdmVycmlkZSBwcmVkZWZpbmVkIG5hbWVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19wcmVkZWZpbmVkX292ZXJyaWRlKGNvbnN0IHN0cnVjdCBhY3BpX3ByZWRlZmluZWRfbmFtZXMgKmluaXRfdmFsLAorCQkJICAgIGFjcGlfc3RyaW5nICpuZXdfdmFsKQoreworCisJaWYgKCFpbml0X3ZhbCB8fCAhbmV3X3ZhbCkgeworCQlyZXR1cm4gKEFFX0JBRF9QQVJBTUVURVIpOworCX0KKworCSpuZXdfdmFsID0gTlVMTDsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3RhYmxlX292ZXJyaWRlCisgKgorICogUEFSQU1FVEVSUzogIGV4aXN0aW5nX3RhYmxlICAgICAgLSBIZWFkZXIgb2YgY3VycmVudCB0YWJsZSAocHJvYmFibHkKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlybXdhcmUpCisgKiAgICAgICAgICAgICAgbmV3X3RhYmxlICAgICAgICAgICAtIFdoZXJlIGFuIGVudGlyZSBuZXcgdGFibGUgaXMgcmV0dXJuZWQuCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cywgcG9pbnRlciB0byBuZXcgdGFibGUuIE51bGwgcG9pbnRlciByZXR1cm5lZCBpZiBubworICogICAgICAgICAgICAgIHRhYmxlIGlzIGF2YWlsYWJsZSB0byBvdmVycmlkZQorICoKKyAqIERFU0NSSVBUSU9OOiBSZXR1cm4gYSBkaWZmZXJlbnQgdmVyc2lvbiBvZiBhIHRhYmxlIGlmIG9uZSBpcyBhdmFpbGFibGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzCithY3BpX29zX3RhYmxlX292ZXJyaWRlKHN0cnVjdCBhY3BpX3RhYmxlX2hlYWRlciAqZXhpc3RpbmdfdGFibGUsCisJCSAgICAgICBzdHJ1Y3QgYWNwaV90YWJsZV9oZWFkZXIgKipuZXdfdGFibGUpCit7CisKKwlpZiAoIWV4aXN0aW5nX3RhYmxlIHx8ICFuZXdfdGFibGUpIHsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisKKwkqbmV3X3RhYmxlID0gTlVMTDsKKworI2lmZGVmIEFDUElfRVhFQ19BUFAKKworCWFlX3RhYmxlX292ZXJyaWRlKGV4aXN0aW5nX3RhYmxlLCBuZXdfdGFibGUpOworCXJldHVybiAoQUVfT0spOworI2Vsc2UKKworCXJldHVybiAoQUVfTk9fQUNQSV9UQUJMRVMpOworI2VuZGlmCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19waHlzaWNhbF90YWJsZV9vdmVycmlkZQorICoKKyAqIFBBUkFNRVRFUlM6ICBleGlzdGluZ190YWJsZSAgICAgIC0gSGVhZGVyIG9mIGN1cnJlbnQgdGFibGUgKHByb2JhYmx5IGZpcm13YXJlKQorICogICAgICAgICAgICAgIG5ld19hZGRyZXNzICAgICAgICAgLSBXaGVyZSBuZXcgdGFibGUgYWRkcmVzcyBpcyByZXR1cm5lZAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUGh5c2ljYWwgYWRkcmVzcykKKyAqICAgICAgICAgICAgICBuZXdfdGFibGVfbGVuZ3RoICAgIC0gV2hlcmUgbmV3IHRhYmxlIGxlbmd0aCBpcyByZXR1cm5lZAorICoKKyAqIFJFVFVSTjogICAgICBTdGF0dXMsIGFkZHJlc3MvbGVuZ3RoIG9mIG5ldyB0YWJsZS4gTnVsbCBwb2ludGVyIHJldHVybmVkCisgKiAgICAgICAgICAgICAgaWYgbm8gdGFibGUgaXMgYXZhaWxhYmxlIHRvIG92ZXJyaWRlLgorICoKKyAqIERFU0NSSVBUSU9OOiBSZXR1cm5zIEFFX1NVUFBPUlQsIGZ1bmN0aW9uIG5vdCB1c2VkIGluIHVzZXIgc3BhY2UuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19waHlzaWNhbF90YWJsZV9vdmVycmlkZShzdHJ1Y3QgYWNwaV90YWJsZV9oZWFkZXIgKmV4aXN0aW5nX3RhYmxlLAorCQkJCWFjcGlfcGh5c2ljYWxfYWRkcmVzcyAqbmV3X2FkZHJlc3MsCisJCQkJdTMyICpuZXdfdGFibGVfbGVuZ3RoKQoreworCisJcmV0dXJuIChBRV9TVVBQT1JUKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2VudGVyX3NsZWVwCisgKgorICogUEFSQU1FVEVSUzogIHNsZWVwX3N0YXRlICAgICAgICAgLSBXaGljaCBzbGVlcCBzdGF0ZSB0byBlbnRlcgorICogICAgICAgICAgICAgIHJlZ2FfdmFsdWUgICAgICAgICAgLSBSZWdpc3RlciBBIHZhbHVlCisgKiAgICAgICAgICAgICAgcmVnYl92YWx1ZSAgICAgICAgICAtIFJlZ2lzdGVyIEIgdmFsdWUKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IEEgaG9vayBiZWZvcmUgd3JpdGluZyBzbGVlcCByZWdpc3RlcnMgdG8gZW50ZXIgdGhlIHNsZWVwCisgKiAgICAgICAgICAgICAgc3RhdGUuIFJldHVybiBBRV9DVFJMX1RFUk1JTkFURSB0byBza2lwIGZ1cnRoZXIgc2xlZXAgcmVnaXN0ZXIKKyAqICAgICAgICAgICAgICB3cml0ZXMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cyBhY3BpX29zX2VudGVyX3NsZWVwKHU4IHNsZWVwX3N0YXRlLCB1MzIgcmVnYV92YWx1ZSwgdTMyIHJlZ2JfdmFsdWUpCit7CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3JlZGlyZWN0X291dHB1dAorICoKKyAqIFBBUkFNRVRFUlM6ICBkZXN0aW5hdGlvbiAgICAgICAgIC0gQW4gb3BlbiBmaWxlIGhhbmRsZS9wb2ludGVyCisgKgorICogUkVUVVJOOiAgICAgIE5vbmUKKyAqCisgKiBERVNDUklQVElPTjogQ2F1c2VzIHJlZGlyZWN0IG9mIGFjcGlfb3NfcHJpbnRmIGFuZCBhY3BpX29zX3ZwcmludGYKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgYWNwaV9vc19yZWRpcmVjdF9vdXRwdXQodm9pZCAqZGVzdGluYXRpb24pCit7CisKKwlhY3BpX2dibF9vdXRwdXRfZmlsZSA9IGRlc3RpbmF0aW9uOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfcHJpbnRmCisgKgorICogUEFSQU1FVEVSUzogIGZtdCwgLi4uICAgICAgICAgICAgLSBTdGFuZGFyZCBwcmludGYgZm9ybWF0CisgKgorICogUkVUVVJOOiAgICAgIE5vbmUKKyAqCisgKiBERVNDUklQVElPTjogRm9ybWF0dGVkIG91dHB1dC4gTm90ZTogdmVyeSBzaW1pbGFyIHRvIGFjcGlfb3NfdnByaW50ZgorICogICAgICAgICAgICAgIChwZXJmb3JtYW5jZSksIGNoYW5nZXMgc2hvdWxkIGJlIHRyYWNrZWQgaW4gYm90aCBmdW5jdGlvbnMuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkIEFDUElfSU5URVJOQUxfVkFSX1hGQUNFIGFjcGlfb3NfcHJpbnRmKGNvbnN0IGNoYXIgKmZtdCwgLi4uKQoreworCXZhX2xpc3QgYXJnczsKKwl1OCBmbGFnczsKKworCWZsYWdzID0g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bGluZQorICogICAgICAgICAgICAgIGJ1ZmZlcl9sZW5ndGggICAgICAgLSBNYXhpbXVtIGxlbmd0aCBvZiBCdWZmZXIKKyAqICAgICAgICAgICAgICBieXRlc19yZWFkICAgICAgICAgIC0gV2hlcmUgdGhlIGFjdHVhbCBieXRlIGNvdW50IGlzIHJldHVybmVkCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cyBhbmQgYWN0dWFsIGJ5dGVzIHJlYWQKKyAqCisgKiBERVNDUklQVElPTjogR2V0IHRoZSBuZXh0IGlucHV0IGxpbmUgZnJvbSB0aGUgdGVybWluYWwuIE5PVEU6IEZvciB0aGUKKyAqICAgICAgICAgICAgICBhY3BpX2V4ZWMgdXRpbGl0eSwgd2UgdXNlIHRoZSBhY2dldGxpbmUgbW9kdWxlIGluc3RlYWQgdG8KKyAqICAgICAgICAgICAgICBwcm92aWRlIGxpbmUtZWRpdGluZyBhbmQgaGlzdG9yeSBzdXBwb3J0LgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworYWNwaV9zdGF0dXMgYWNwaV9vc19nZXRfbGluZShjaGFyICpidWZmZXIsIHUzMiBidWZmZXJfbGVuZ3RoLCB1MzIgKmJ5dGVzX3JlYWQpCit7CisJaW50IGlucHV0X2NoYXI7CisJdTMyIGVuZF9vZl9saW5lOworCisJLyogU3RhbmRhcmQgYWNwaV9vc19nZXRfbGluZSBmb3IgYWxsIHV0aWxpdGllcyBleGNlcHQgYWNwaV9leGVjICovCisKKwlmb3IgKGVuZF9vZl9saW5lID0gMDs7IGVuZF9vZl9saW5lKyspIHsKKwkJaWYgKGVuZF9vZl9saW5lID49IGJ1ZmZlcl9sZW5ndGgpIHsKKwkJCXJldHVybiAoQUVfQlVGRkVSX09WRVJGTE9XKTsKKwkJfQorCisJCWlmICgoaW5wdXRfY2hhciA9IGdldGNoYXIoKSkgPT0gRU9GKSB7CisJCQlyZXR1cm4gKEFFX0VSUk9SKTsKKwkJfQorCisJCWlmICghaW5wdXRfY2hhciB8fCBpbnB1dF9jaGFyID09IF9BU0NJSV9ORVdMSU5FKSB7CisJCQlicmVhazsKKwkJfQorCisJCWJ1ZmZlcltlbmRfb2ZfbGluZV0gPSAoY2hhcilpbnB1dF9jaGFyOworCX0KKworCS8qIE51bGwgdGVybWluYXRlIHRoZSBidWZmZXIgKi8KKworCWJ1ZmZlcltlbmRfb2ZfbGluZV0gPSAwOworCisJLyogUmV0dXJuIHRoZSBudW1iZXIgb2YgYnl0ZXMgaW4gdGhlIHN0cmluZyAqLworCisJaWYgKGJ5dGVzX3JlYWQpIHsKKwkJKmJ5dGVzX3JlYWQgPSBlbmRfb2ZfbGluZTsKKwl9CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKyNlbmRpZgorCisjaWZuZGVmIEFDUElfVVNFX05BVElWRV9NRU1PUllfTUFQUElORworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX21hcF9tZW1vcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgd2hlcmUgICAgICAgICAgICAgICAtIFBoeXNpY2FsIGFkZHJlc3Mgb2YgbWVtb3J5IHRvIGJlIG1hcHBlZAorICogICAgICAgICAgICAgIGxlbmd0aCAgICAgICAgICAgICAgLSBIb3cgbXVjaCBtZW1vcnkgdG8gbWFwCisgKgorICogUkVUVVJOOiAgICAgIFBvaW50ZXIgdG8gbWFwcGVkIG1lbW9yeS4gTnVsbCBvbiBlcnJvci4KKyAqCisgKiBERVNDUklQVElPTjogTWFwIHBoeXNpY2FsIG1lbW9yeSBpbnRvIGNhbGxlcidzIGFkZHJlc3Mgc3BhY2UKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgKmFjcGlfb3NfbWFwX21lbW9yeShhY3BpX3BoeXNpY2FsX2FkZHJlc3Mgd2hlcmUsIGFjcGlfc2l6ZSBsZW5ndGgpCit7CisKKwlyZXR1cm4gKEFDUElfVE9fUE9JTlRFUigoYWNwaV9zaXplKXdoZXJlKSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc191bm1hcF9tZW1vcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgd2hlcmUgICAgICAgICAgICAgICAtIExvZ2ljYWwgYWRkcmVzcyBvZiBtZW1vcnkgdG8gYmUgdW5tYXBwZWQKKyAqICAgICAgICAgICAgICBsZW5ndGggICAgICAgICAgICAgIC0gSG93IG11Y2ggbWVtb3J5IHRvIHVubWFwCisgKgorICogUkVUVVJOOiAgICAgIE5vbmUuCisgKgorICogREVTQ1JJUFRJT046IERlbGV0ZSBhIHByZXZpb3VzbHkgY3JlYXRlZCBtYXBwaW5nLiBXaGVyZSBhbmQgTGVuZ3RoIG11c3QKKyAqICAgICAgICAgICAgICBjb3JyZXNwb25kIHRvIGEgcHJldmlvdXMgbWFwcGluZyBleGFjdGx5LgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZCBhY3BpX29zX3VubWFwX21lbW9yeSh2b2lkICp3aGVyZSwgYWNwaV9zaXplIGxlbmd0aCkKK3sKKworCXJldHVybjsKK30KKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfYWxsb2NhdGUKKyAqCisgKiBQQVJBTUVURVJTOiAgc2l6ZSAgICAgICAgICAgICAgICAtIEFtb3VudCB0byBhbGxvY2F0ZSwgaW4gYnl0ZXMKKyAqCisgKiBSRVRVUk46ICAgICAgUG9pbnRlciB0byB0aGUgbmV3IGFsbG9jYXRpb24uIE51bGwgb24gZXJyb3IuCisgKgorICogREVTQ1JJUFRJT046IEFsbG9jYXRlIG1lbW9yeS4gQWxnb3JpdGhtIGlzIGRlcGVuZGVudCBvbiB0aGUgT1MuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkICphY3BpX29zX2FsbG9jYXRlKGFjcGlfc2l6ZSBzaXplKQoreworCXZvaWQgKm1lbTsKKworCW1lbSA9ICh2b2lkICopbWFsbG9jKChzaXplX3QpIHNpemUpOworCXJldHVybiAobWVtKTsKK30KKworI2lmZGVmIFVTRV9OQVRJVkVfQUxMT0NBVEVfWkVST0VECisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfYWxsb2NhdGVfemVyb2VkCisgKgorICogUEFSQU1FVEVSUzogIHNpemUgICAgICAgICAgICAgICAgLSBBbW91bnQgdG8gYWxsb2NhdGUsIGluIGJ5dGVzCisgKgorICogUkVUVVJOOiAgICAgIFBvaW50ZXIgdG8gdGhlIG5ldyBhbGxvY2F0aW9uLiBOdWxsIG9uIGVycm9yLgorICoKKyAqIERFU0NSSVBUSU9OOiBBbGxvY2F0ZSBhbmQgemVybyBtZW1vcnkuIEFsZ29yaXRobSBpcyBkZXBlbmRlbnQgb24gdGhlIE9TLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZCAqYWNwaV9vc19hbGxvY2F0ZV96ZXJvZWQoYWNwaV9zaXplIHNpemUpCit7CisJdm9pZCAqbWVtOworCisJbWVtID0gKHZvaWQgKiljYWxsb2MoMSwgKHNpemVfdCkgc2l6ZSk7CisJcmV0dXJuIChtZW0pOworfQorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19mcmVlCisgKgorICogUEFSQU1FVEVSUzogIG1lbSAgICAgICAgICAgICAgICAgLSBQb2ludGVyIHRvIHByZXZpb3VzbHkgYWxsb2NhdGVkIG1lbW9yeQorICoKKyAqIFJFVFVSTjogICAgICBOb25lLgorICoKKyAqIERFU0NSSVBUSU9OOiBGcmVlIG1lbW9yeSBhbGxvY2F0ZWQgdmlhIGFjcGlfb3NfYWxsb2NhdGUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgYWNwaV9vc19mcmVlKHZvaWQgKm1lbSkKK3sKKworCWZyZWUobWVtKTsKK30KKworI2lmZGVmIEFDUElfU0lOR0xFX1RIUkVBREVECisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIFNlbWFwaG9yZSBzdHViIGZ1bmN0aW9ucworICoKKyAqIERFU0NSSVBUSU9OOiBTdHViIGZ1bmN0aW9ucyB1c2VkIGZvciBzaW5nbGUtdGhyZWFkIGFwcGxpY2F0aW9ucyB0aGF0IGRvCisgKiAgICAgICAgICAgICAgbm90IHJlcXVpcmUgc2VtYXBob3JlIHN5bmNocm9uaXphdGlvbi4gRnVsbCBpbXBsZW1lbnRhdGlvbnMKKyAqICAgICAgICAgICAgICBvZiB0aGVzZSBmdW5jdGlvbnMgYXBwZWFyIGFmdGVyIHRoZSBzdHVicy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzCithY3BpX29zX2NyZWF0ZV9zZW1hcGhvcmUodTMyIG1heF91bml0cywKKwkJCSB1MzIgaW5pdGlhbF91bml0cywgYWNwaV9oYW5kbGUgKm91dF9oYW5kbGUpCit7CisJKm91dF9oYW5kbGUgPSAoYWNwaV9oYW5kbGUpMTsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworYWNwaV9zdGF0dXMgYWNwaV9vc19kZWxldGVfc2VtYXBob3JlKGFjcGlfaGFuZGxlIGhhbmRsZSkKK3sKKwlyZXR1cm4gKEFFX09LKTsKK30KKworYWNwaV9zdGF0dXMgYWNwaV9vc193YWl0X3NlbWFwaG9yZShhY3BpX2hhbmRsZSBoYW5kbGUsIHUzMiB1bml0cywgdTE2IHRpbWVvdXQpCit7CisJcmV0dXJuIChBRV9PSyk7Cit9CisKK2FjcGlfc3RhdHVzIGFjcGlfb3Nfc2lnbmFsX3NlbWFwaG9yZShhY3BpX2hhbmRsZSBoYW5kbGUsIHUzMiB1bml0cykKK3sKKwlyZXR1cm4gKEFFX09LKTsKK30KKworI2Vsc2UKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19jcmVhdGVfc2VtYXBob3JlCisgKgorICogUEFSQU1FVEVSUzogIGluaXRpYWxfdW5pdHMgICAgICAgLSBVbml0cyB0byBiZSBhc3NpZ25lZCB0byB0aGUgbmV3IHNlbWFwaG9yZQorICogICAgICAgICAgICAgIG91dF9oYW5kbGUgICAgICAgICAgLSBXaGVyZSBhIGhhbmRsZSB3aWxsIGJlIHJldHVybmVkCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cworICoKKyAqIERFU0NSSVBUSU9OOiBDcmVhdGUgYW4gT1Mgc2VtYXBob3JlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19jcmVhdGVfc2VtYXBob3JlKHUzMiBtYXhfdW5pdHMsCisJCQkgdTMyIGluaXRpYWxfdW5pdHMsIGFjcGlfaGFuZGxlICpvdXRfaGFuZGxlKQoreworCXNlbV90ICpzZW07CisKKwlpZiAoIW91dF9oYW5kbGUpIHsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisjaWZkZWYgX19BUFBMRV9fCisJeworCQlzdGF0aWMgaW50IHNlbWFwaG9yZV9jb3VudCA9IDA7CisJCWNoYXIgc2VtYXBob3JlX25hbWVbMzJdOworCisJCXNucHJpbnRmKHNlbWFwaG9yZV9uYW1lLCBzaXplb2Yoc2VtYXBob3JlX25hbWUpLCAiYWNwaV9zZW1fJWQiLAorCQkJIHNlbWFwaG9yZV9jb3VudCsrKTsKKwkJcHJpbnRmKCIlc1xuIiwgc2VtYXBob3JlX25hbWUpOworCQlzZW0gPQorCQkgICAgc2VtX29wZW4oc2VtYXBob3JlX25hbWUsIE9fRVhDTCB8IE9fQ1JFQVQsIDA3NTUsCisJCQkgICAgIGluaXRpYWxfdW5pdHMpOworCQlpZiAoIXNlbSkgeworCQkJcmV0dXJuIChBRV9OT19NRU1PUlkpOworCQl9CisJCXNlbV91bmxpbmsoc2VtYXBob3JlX25hbWUpOwkvKiBUaGlzIGp1c3QgZGVsZXRlcyB0aGUgbmFtZSAqLworCX0KKworI2Vsc2UKKwlzZW0gPSBhY3BpX29zX2FsbG9jYXRlKHNpemVvZihzZW1fdCkpOworCWlmICghc2VtKSB7CisJCXJldHVybiAoQUVfTk9fTUVNT1JZKTsKKwl9CisKKwlpZiAoc2VtX2luaXQoc2VtLCAwLCBpbml0aWFsX3VuaXRzKSA9PSAtMSkgeworCQlhY3BpX29zX2ZyZWUoc2VtKTsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisjZW5kaWYKKworCSpvdXRfaGFuZGxlID0gKGFjcGlfaGFuZGxlKXNlbTsKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2RlbGV0ZV9zZW1hcGhvcmUKKyAqCisgKiBQQVJBTUVURVJTOiAgaGFuZGxlICAgICAgICAgICAgICAtIEhhbmRsZSByZXR1cm5lZCBieSBhY3BpX29zX2NyZWF0ZV9zZW1hcGhvcmUKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IERlbGV0ZSBhbiBPUyBzZW1hcGhvcmUKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzIGFjcGlfb3NfZGVsZXRlX3NlbWFwaG9yZShhY3BpX2hhbmRsZSBoYW5kbGUpCit7CisJc2VtX3QgKnNlbSA9IChzZW1fdCAqKSBoYW5kbGU7CisKKwlpZiAoIXNlbSkgeworCQlyZXR1cm4gKEFFX0JBRF9QQVJBTUVURVIpOworCX0KKyNpZmRlZiBfX0FQUExFX18KKwlpZiAoc2VtX2Nsb3NlKHNlbSkgPT0gLTEpIHsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisjZWxzZQorCWlmIChzZW1fZGVzdHJveShzZW0pID09IC0xKSB7CisJCXJldHVybiAoQUVfQkFEX1BBUkFNRVRFUik7CisJfQorI2VuZGlmCisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3dhaXRfc2VtYXBob3JlCisgKgorICogUEFSQU1FVEVSUzogIGhhbmRsZSAgICAgICAgICAgICAgLSBIYW5kbGUgcmV0dXJuZWQgYnkgYWNwaV9vc19jcmVhdGVfc2VtYXBob3JlCisgKiAgICAgICAgICAgICAgdW5pdHMgICAgICAgICAgICAgICAtIEhvdyBtYW55IHVuaXRzIHRvIHdhaXQgZm9yCisgKiAgICAgICAgICAgICAgbXNlY190aW1lb3V0ICAgICAgICAtIEhvdyBsb25nIHRvIHdhaXQgKG1pbGxpc2Vjb25kcykKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IFdhaXQgZm9yIHVuaXRzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc193YWl0X3NlbWFwaG9yZShhY3BpX2hhbmRsZSBoYW5kbGUsIHUzMiB1bml0cywgdTE2IG1zZWNfdGltZW91dCkKK3sKKwlhY3BpX3N0YXR1cyBzdGF0dXMgPSBBRV9PSzsKKwlzZW1fdCAqc2VtID0gKHNlbV90ICopIGhhbmRsZTsKKwlpbnQgcmV0X3ZhbDsKKyNpZm5kZWYgQUNQSV9VU0VfQUxURVJOQVRFX1RJTUVPVVQKKwlzdHJ1Y3QgdGltZXNwZWMgdGltZTsKKyNlbmRpZgorCisJaWYgKCFzZW0pIHsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisKKwlzd2l0Y2ggKG1zZWNfdGltZW91dCkgeworCQkvKgorCQkgKiBObyBXYWl0OgorCQkgKiAtLS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TRUNfUEVSX1NFQyk7CisJCQl0aW1lLnR2X25zZWMgPSAodGltZS50dl9uc2VjICUgQUNQSV9OU0VDX1BFUl9TRUMpOworCQl9CisKKwkJd2hpbGUgKCgocmV0X3ZhbCA9IHNlbV90aW1lZHdhaXQoc2VtLCAmdGltZSkpID09IC0xKQorCQkgICAgICAgJiYgKGVycm5vID09IEVJTlRSKSkgeworCQkJY29udGludWU7CS8qIFJlc3RhcnQgaWYgaW50ZXJydXB0ZWQgKi8KKworCQl9CisKKwkJaWYgKHJldF92YWwgIT0gMCkgeworCQkJaWYgKGVycm5vICE9IEVUSU1FRE9VVCkgeworCQkJCXBlcnJvcigic2VtX3RpbWVkd2FpdCIpOworCQkJfQorCQkJc3RhdHVzID0gKEFFX1RJTUUpOworCQl9CisjZW5kaWYKKwkJYnJlYWs7CisJfQorCisJcmV0dXJuIChzdGF0dXMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3Nfc2lnbmFsX3NlbWFwaG9yZQorICoKKyAqIFBBUkFNRVRFUlM6ICBoYW5kbGUgICAgICAgICAgICAgIC0gSGFuZGxlIHJldHVybmVkIGJ5IGFjcGlfb3NfY3JlYXRlX3NlbWFwaG9yZQorICogICAgICAgICAgICAgIHVuaXRzICAgICAgICAgICAgICAgLSBOdW1iZXIgb2YgdW5pdHMgdG8gc2VuZAorICoKKyAqIFJFVFVSTjogICAgICBTdGF0dXMKKyAqCisgKiBERVNDUklQVElPTjogU2VuZCB1bml0cworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworYWNwaV9zdGF0dXMgYWNwaV9vc19zaWduYWxfc2VtYXBob3JlKGFjcGlfaGFuZGxlIGhhbmRsZSwgdTMyIHVuaXRzKQoreworCXNlbV90ICpzZW0gPSAoc2VtX3QgKikgaGFuZGxlOworCisJaWYgKCFzZW0pIHsKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisKKwlpZiAoc2VtX3Bvc3Qoc2VtKSA9PSAtMSkgeworCQlyZXR1cm4gKEFFX0xJTUlUKTsKKwl9CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworI2VuZGlmCQkJCS8qIEFDUElfU0lOR0xFX1RIUkVBREVEICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgU3BpbmxvY2sgaW50ZXJmYWNlcworICoKKyAqIERFU0NSSVBUSU9OOiBNYXAgdGhlc2UgaW50ZXJmYWNlcyB0byBzZW1hcGhvcmUgaW50ZXJmYWNlcworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworYWNwaV9zdGF0dXMgYWNwaV9vc19jcmVhdGVfbG9jayhhY3BpX3NwaW5sb2NrICogb3V0X2hhbmRsZSkKK3sKKworCXJldHVybiAoYWNwaV9vc19jcmVhdGVfc2VtYXBob3JlKDEsIDEsIG91dF9oYW5kbGUpKTsKK30KKwordm9pZCBhY3BpX29zX2RlbGV0ZV9sb2NrKGFjcGlfc3BpbmxvY2sgaGFuZGxlKQoreworCWFjcGlfb3NfZGVsZXRlX3NlbWFwaG9yZShoYW5kbGUpOworfQorCithY3BpX2NwdV9mbGFncyBhY3BpX29zX2FjcXVpcmVfbG9jayhhY3BpX2hhbmRsZSBoYW5kbGUpCit7CisJYWNwaV9vc193YWl0X3NlbWFwaG9yZShoYW5kbGUsIDEsIDB4RkZGRik7CisJcmV0dXJuICgwKTsKK30KKwordm9pZCBhY3BpX29zX3JlbGVhc2VfbG9jayhhY3BpX3NwaW5sb2NrIGhhbmRsZSwgYWNwaV9jcHVfZmxhZ3MgZmxhZ3MpCit7CisJYWNwaV9vc19zaWduYWxfc2VtYXBob3JlKGhhbmRsZSwgMSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19pbnN0YWxsX2ludGVycnVwdF9oYW5kbGVyCisgKgorICogUEFSQU1FVEVSUzogIGludGVycnVwdF9udW1iZXIgICAgLSBMZXZlbCBoYW5kbGVyIHNob3VsZCByZXNwb25kIHRvLgorICogICAgICAgICAgICAgIGlzciAgICAgICAgICAgICAgICAgLSBBZGRyZXNzIG9mIHRoZSBBQ1BJIGludGVycnVwdCBoYW5kbGVyCisgKiAgICAgICAgICAgICAgZXhjZXB0X3B0ciAgICAgICAgICAtIFdoZXJlIHN0YXR1cyBpcyByZXR1cm5lZAorICoKKyAqIFJFVFVSTjogICAgICBIYW5kbGUgdG8gdGhlIG5ld2x5IGluc3RhbGxlZCBoYW5kbGVyLgorICoKKyAqIERFU0NSSVBUSU9OOiBJbnN0YWxsIGFuIGludGVycnVwdCBoYW5kbGVyLiBVc2VkIHRvIGluc3RhbGwgdGhlIEFDUEkKKyAqICAgICAgICAgICAgICBPUy1pbmRlcGVuZGVudCBoYW5kbGVyLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordTMyCithY3BpX29zX2luc3RhbGxfaW50ZXJydXB0X2hhbmRsZXIodTMyIGludGVycnVwdF9udW1iZXIsCisJCQkJICBhY3BpX29zZF9oYW5kbGVyIHNlcnZpY2Vfcm91dGluZSwKKwkJCQkgIHZvaWQgKmNvbnRleHQpCit7CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3JlbW92ZV9pbnRlcnJ1cHRfaGFuZGxlcgorICoKKyAqIFBBUkFNRVRFUlM6ICBoYW5kbGUgICAgICAgICAgICAgIC0gUmV0dXJuZWQgd2hlbiBoYW5kbGVyIHdhcyBpbnN0YWxsZWQKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IFVuaW5zdGFsbHMgYW4gaW50ZXJydXB0IGhhbmRsZXIuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19yZW1vdmVfaW50ZXJydXB0X2hhbmRsZXIodTMyIGludGVycnVwdF9udW1iZXIsCisJCQkJIGFjcGlfb3NkX2hhbmRsZXIgc2VydmljZV9yb3V0aW5lKQoreworCisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc19zdGFsbAorICoKKyAqIFBBUkFNRVRFUlM6ICBtaWNyb3NlY29uZHMgICAgICAgIC0gVGltZSB0byBzbGVlcAorICoKKyAqIFJFVFVSTjogICAgICBCbG9ja3MgdW50aWwgc2xlZXAgaXMgY29tcGxldGVkLgorICoKKyAqIERFU0NSSVBUSU9OOiBTbGVlcCBhdCBtaWNyb3NlY29uZCBncmFudWxhcml0eQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordm9pZCBhY3BpX29zX3N0YWxsKHUzMiBtaWNyb3NlY29uZHMpCit7CisKKwlpZiAobWljcm9zZWNvbmRzKSB7CisJCXVzbGVlcChtaWNyb3NlY29uZHMpOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3NsZWVwCisgKgorICogUEFSQU1FVEVSUzogIG1pbGxpc2Vjb25kcyAgICAgICAgLSBUaW1lIHRvIHNsZWVwCisgKgorICogUkVUVVJOOiAgICAgIEJsb2NrcyB1bnRpbCBzbGVlcCBpcyBjb21wbGV0ZWQuCisgKgorICogREVTQ1JJUFRJT046IFNsZWVwIGF0IG1pbGxpc2Vjb25kIGdyYW51bGFyaXR5CisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCit2b2lkIGFjcGlfb3Nfc2xlZXAodTY0IG1pbGxpc2Vjb25kcykKK3sKKworCS8qIFNsZWVwIGZvciB3aG9sZSBzZWNvbmRzICovCisKKwlzbGVlcChtaWxsaXNlY29uZHMgLyBBQ1BJX01TRUNfUEVSX1NFQyk7CisKKwkvKgorCSAqIFNsZWVwIGZvciByZW1haW5pbmcgbWljcm9zZWNvbmRzLgorCSAqIEFyZyB0byB1c2xlZXAoKSBpcyBpbiB1c2VjcyBhbmQgbXVzdCBiZSBsZXNzIHRoYW4gMSwwMDAsMDAwICgxIHNlY29uZCkuCisJICovCisJdXNsZWVwKChtaWxsaXNlY29uZHMgJSBBQ1BJX01TRUNfUEVSX1NFQykgKiBBQ1BJX1VTRUNfUEVSX01TRUMpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfZ2V0X3RpbWVyCisgKgorICogUEFSQU1FVEVSUzogIE5vbmUKKyAqCisgKiBSRVRVUk46ICAgICAgQ3VycmVudCB0aW1lIGluIDEwMCBuYW5vc2Vjb25kIHVuaXRzCisgKgorICogREVTQ1JJUFRJT046IEdldCB0aGUgY3VycmVudCBzeXN0ZW0gdGltZQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordTY0IGFjcGlfb3NfZ2V0X3RpbWVyKHZvaWQpCit7CisJc3RydWN0IHRpbWV2YWwgdGltZTsKKworCS8qIFRoaXMgdGltZXIgaGFzIHN1ZmZpY2llbnQgcmVzb2x1dGlvbiBmb3IgdXNlci1zcGFjZSBhcHBsaWNhdGlvbiBjb2RlICovCisKKwlnZXR0aW1lb2ZkYXkoJnRpbWUsIE5VTEwpOworCisJLyogKFNlY29uZHMgKiAxMF43ID0gMTAwbnMoMTBeLTcpKSArIChNaWNyb3NlY29uZHMoMTBeLTYpICogMTBeMSA9IDEwMG5zKSAqLworCisJcmV0dXJuICgoKHU2NCl0aW1lLnR2X3NlYyAqIEFDUElfMTAwTlNFQ19QRVJfU0VDKSArCisJCSgodTY0KXRpbWUudHZfdXNlYyAqIEFDUElfMTAwTlNFQ19QRVJfVVNFQykpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfcmVhZF9wY2lfY29uZmlndXJhdGlvbgorICoKKyAqIFBBUkFNRVRFUlM6ICBwY2lfaWQgICAgICAgICAgICAgIC0gU2VnL0J1cy9EZXYKKyAqICAgICAgICAgICAgICBwY2lfcmVnaXN0ZXIgICAgICAgIC0gRGV2aWNlIFJlZ2lzdGVyCisgKiAgICAgICAgICAgICAgdmFsdWUgICAgICAgICAgICAgICAtIEJ1ZmZlciB3aGVyZSB2YWx1ZSBpcyBwbGFjZWQKKyAqICAgICAgICAgICAgICB3aWR0aCAgICAgICAgICAgICAgIC0gTnVtYmVyIG9mIGJpdHMKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzCisgKgorICogREVTQ1JJUFRJT046IFJlYWQgZGF0YSBmcm9tIFBDSSBjb25maWd1cmF0aW9uIHNwYWNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19yZWFkX3BjaV9jb25maWd1cmF0aW9uKHN0cnVjdCBhY3BpX3BjaV9pZCAqcGNpX2lkLAorCQkJICAgICAgIHUzMiBwY2lfcmVnaXN0ZXIsIHU2NCAqdmFsdWUsIHUzMiB3aWR0aCkKK3sKKworCSp2YWx1ZSA9IDA7CisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc193cml0ZV9wY2lfY29uZmlndXJhdGlvbgorICoKKyAqIFBBUkFNRVRFUlM6ICBwY2lfaWQgICAgICAgICAgICAgIC0gU2VnL0J1cy9EZXYKKyAqICAgICAgICAgICAgICBwY2lfcmVnaXN0ZXIgICAgICAgIC0gRGV2aWNlIFJlZ2lzdGVyCisgKiAgICAgICAgICAgICAgdmFsdWUgICAgICAgICAgICAgICAtIFZhbHVlIHRvIGJlIHdyaXR0ZW4KKyAqICAgICAgICAgICAgICB3aWR0aCAgICAgICAgICAgICAgIC0gTnVtYmVyIG9mIGJpdHMKKyAqCisgKiBSRVRVUk46ICAgICAgU3RhdHVzLgorICoKKyAqIERFU0NSSVBUSU9OOiBXcml0ZSBkYXRhIHRvIFBDSSBjb25maWd1cmF0aW9uIHNwYWNlCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc193cml0ZV9wY2lfY29uZmlndXJhdGlvbihzdHJ1Y3QgYWNwaV9wY2lfaWQgKnBjaV9pZCwKKwkJCQl1MzIgcGNpX3JlZ2lzdGVyLCB1NjQgdmFsdWUsIHUzMiB3aWR0aCkKK3sKKworCXJldHVybiAoQUVfT0spOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfcmVhZF9wb3J0CisgKgorICogUEFSQU1FVEVSUzogIGFkZHJlc3MgICAgICAgICAgICAgLSBBZGRyZXNzIG9mIEkvTyBwb3J0L3JlZ2lzdGVyIHRvIHJlYWQKKyAqICAgICAgICAgICAgICB2YWx1ZSAgICAgICAgICAgICAgIC0gV2hlcmUgdmFsdWUgaXMgcGxhY2VkCisgKiAgICAgICAgICAgICAgd2lkdGggICAgICAgICAgICAgICAtIE51bWJlciBvZiBiaXRzCisgKgorICogUkVUVVJOOiAgICAgIFZhbHVlIHJlYWQgZnJvbSBwb3J0CisgKgorICogREVTQ1JJUFRJT046IFJlYWQgZGF0YSBmcm9tIGFuIEkvTyBwb3J0IG9yIHJlZ2lzdGVyCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cyBhY3BpX29zX3JlYWRfcG9ydChhY3BpX2lvX2FkZHJlc3MgYWRkcmVzcywgdTMyICp2YWx1ZSwgdTMyIHdpZHRoKQoreworCisJc3dpdGNoICh3aWR0aCkgeworCWNhc2UgODoKKworCQkqdmFsdWUgPSAweEZGOworCQlicmVhazsKKworCWNhc2UgMTY6CisKKwkJKnZhbHVlID0gMHhGRkZGOworCQlicmVhazsKKworCWNhc2UgMzI6CisKKwkJKnZhbHVlID0gMHhGRkZGRkZGRjsKKwkJYnJlYWs7CisKKwlkZWZhdWx0OgorCisJCXJldHVybiAoQUVfQkFEX1BBUkFNRVRFUik7CisJfQorCisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc193cml0ZV9wb3J0CisgKgorICogUEFSQU1FVEVSUzogIGFkZHJlc3MgICAgICAgICAgICAgLSBBZGRyZXNzIG9mIEkvTyBwb3J0L3JlZ2lzdGVyIHRvIHdyaXRlCisgKiAgICAgICAgICAgICAgdmFsdWUgICAgICAgICAgICAgICAtIFZhbHVlIHRvIHdyaXRlCisgKiAgICAgICAgICAgICAgd2lkdGggICAgICAgICAgICAgICAtIE51bWJlciBvZiBiaXRzCisgKgorICogUkVUVVJOOiAgICAgIE5vbmUKKyAqCisgKiBERVNDUklQVElPTjogV3JpdGUgZGF0YSB0byBhbiBJL08gcG9ydCBvciByZWdpc3RlcgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworYWNwaV9zdGF0dXMgYWNwaV9vc193cml0ZV9wb3J0KGFjcGlfaW9fYWRkcmVzcyBhZGRyZXNzLCB1MzIgdmFsdWUsIHUzMiB3aWR0aCkKK3sKKworCXJldHVybiAoQUVfT0spOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfcmVhZF9tZW1vcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgYWRkcmVzcyAgICAgICAgICAgICAtIFBoeXNpY2FsIE1lbW9yeSBBZGRyZXNzIHRvIHJlYWQKKyAqICAgICAgICAgICAgICB2YWx1ZSAgICAgICAgICAgICAgIC0gV2hlcmUgdmFsdWUgaXMgcGxhY2VkCisgKiAgICAgICAgICAgICAgd2lkdGggICAgICAgICAgICAgICAtIE51bWJlciBvZiBiaXRzICg4LDE2LDMyLCBvciA2NCkKKyAqCisgKiBSRVRVUk46ICAgICAgVmFsdWUgcmVhZCBmcm9tIHBoeXNpY2FsIG1lbW9yeSBhZGRyZXNzLiBBbHdheXMgcmV0dXJuZWQKKyAqICAgICAgICAgICAgICBhcyBhIDY0LWJpdCBpbnRlZ2VyLCByZWdhcmRsZXNzIG9mIHRoZSByZWFkIHdpZHRoLgorICoKKyAqIERFU0NSSVBUSU9OOiBSZWFkIGRhdGEgZnJvbSBhIHBoeXNpY2FsIG1lbW9yeSBhZGRyZXNzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3N0YXR1cworYWNwaV9vc19yZWFkX21lbW9yeShhY3BpX3BoeXNpY2FsX2FkZHJlc3MgYWRkcmVzcywgdTY0ICp2YWx1ZSwgdTMyIHdpZHRoKQoreworCisJc3dpdGNoICh3aWR0aCkgeworCWNhc2UgODoKKwljYXNlIDE2OgorCWNhc2UgMzI6CisJY2FzZSA2NDoKKworCQkqdmFsdWUgPSAwOworCQlicmVhazsKKworCWRlZmF1bHQ6CisKKwkJcmV0dXJuIChBRV9CQURfUEFSQU1FVEVSKTsKKwl9CisJcmV0dXJuIChBRV9PSyk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBGVU5DVElPTjogICAgYWNwaV9vc193cml0ZV9tZW1vcnkKKyAqCisgKiBQQVJBTUVURVJTOiAgYWRkcmVzcyAgICAgICAgICAgICAtIFBoeXNpY2FsIE1lbW9yeSBBZGRyZXNzIHRvIHdyaXRlCisgKiAgICAgICAgICAgICAgdmFsdWUgICAgICAgICAgICAgICAtIFZhbHVlIHRvIHdyaXRlCisgKiAgICAgICAgICAgICAgd2lkdGggICAgICAgICAgICAgICAtIE51bWJlciBvZiBiaXRzICg4LDE2LDMyLCBvciA2NCkKKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZQorICoKKyAqIERFU0NSSVBUSU9OOiBXcml0ZSBkYXRhIHRvIGEgcGh5c2ljYWwgbWVtb3J5IGFkZHJlc3MKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzCithY3BpX29zX3dyaXRlX21lbW9yeShhY3BpX3BoeXNpY2FsX2FkZHJlc3MgYWRkcmVzcywgdTY0IHZhbHVlLCB1MzIgd2lkdGgpCit7CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3JlYWRhYmxlCisgKgorICogUEFSQU1FVEVSUzogIHBvaW50ZXIgICAgICAgICAgICAgLSBBcmVhIHRvIGJlIHZlcmlmaWVkCisgKiAgICAgICAgICAgICAgbGVuZ3RoICAgICAgICAgICAgICAtIFNpemUgb2YgYXJlYQorICoKKyAqIFJFVFVSTjogICAgICBUUlVFIGlmIHJlYWRhYmxlIGZvciBlbnRpcmUgbGVuZ3RoCisgKgorICogREVTQ1JJUFRJT046IFZlcmlmeSB0aGF0IGEgcG9pbnRlciBpcyB2YWxpZCBmb3IgcmVhZGluZworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordTggYWNwaV9vc19yZWFkYWJsZSh2b2lkICpwb2ludGVyLCBhY3BpX3NpemUgbGVuZ3RoKQoreworCisJcmV0dXJuIChUUlVFKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3dyaXRhYmxlCisgKgorICogUEFSQU1FVEVSUzogIHBvaW50ZXIgICAgICAgICAgICAgLSBBcmVhIHRvIGJlIHZlcmlmaWVkCisgKiAgICAgICAgICAgICAgbGVuZ3RoICAgICAgICAgICAgICAtIFNpemUgb2YgYXJlYQorICoKKyAqIFJFVFVSTjogICAgICBUUlVFIGlmIHdyaXRhYmxlIGZvciBlbnRpcmUgbGVuZ3RoCisgKgorICogREVTQ1JJUFRJT046IFZlcmlmeSB0aGF0IGEgcG9pbnRlciBpcyB2YWxpZCBmb3Igd3JpdGluZworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwordTggYWNwaV9vc193cml0YWJsZSh2b2lkICpwb2ludGVyLCBhY3BpX3NpemUgbGVuZ3RoKQoreworCisJcmV0dXJuIChUUlVFKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3NpZ25hbAorICoKKyAqIFBBUkFNRVRFUlM6ICBmdW5jdGlvbiAgICAgICAgICAgIC0gQUNQSSBBIHNpZ25hbCBmdW5jdGlvbiBjb2RlCisgKiAgICAgICAgICAgICAgaW5mbyAgICAgICAgICAgICAgICAtIFBvaW50ZXIgdG8gZnVuY3Rpb24tZGVwZW5kZW50IHN0cnVjdHVyZQorICoKKyAqIFJFVFVSTjogICAgICBTdGF0dXMKKyAqCisgKiBERVNDUklQVElPTjogTWlzY2VsbGFuZW91cyBmdW5jdGlvbnMuIEV4YW1wbGUgaW1wbGVtZW50YXRpb24gb25seS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzIGFjcGlfb3Nfc2lnbmFsKHUzMiBmdW5jdGlvbiwgdm9pZCAqaW5mbykKK3sKKworCXN3aXRjaCAoZnVuY3Rpb24pIHsKKwljYXNlIEFDUElfU0lHTkFMX0ZBVEFMOgorCisJCWJyZWFrOworCisJY2FzZSBBQ1BJX1NJR05BTF9CUkVBS1BPSU5UOgorCisJCWJyZWFrOworCisJZGVmYXVsdDoKKworCQlicmVhazsKKwl9CisKKwlyZXR1cm4gKEFFX09LKTsKK30KKworLyogT3B0aW9uYWwgbXVsdGktdGhyZWFkIHN1cHBvcnQgKi8KKworI2lmbmRlZiBBQ1BJX1NJTkdMRV9USFJFQURFRAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX2dldF90aHJlYWRfaWQKKyAqCisgKiBQQVJBTUVURVJTOiAgTm9uZQorICoKKyAqIFJFVFVSTjogICAgICBJZCBvZiB0aGUgcnVubmluZyB0aHJlYWQKKyAqCisgKiBERVNDUklQVElPTjogR2V0IHRoZSBJRCBvZiB0aGUgY3VycmVudCAocnVubmluZykgdGhyZWFkCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCithY3BpX3RocmVhZF9pZCBhY3BpX29zX2dldF90aHJlYWRfaWQodm9pZCkKK3sKKwlwdGhyZWFkX3QgdGhyZWFkOworCisJdGhyZWFkID0gcHRocmVhZF9zZWxmKCk7CisJcmV0dXJuIChBQ1BJX0NBU1RfUFRIUkVBRF9UKHRocmVhZCkpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogRlVOQ1RJT046ICAgIGFjcGlfb3NfZXhlY3V0ZQorICoKKyAqIFBBUkFNRVRFUlM6ICB0eXBlICAgICAgICAgICAgICAgIC0gVHlwZSBvZiBleGVjdXRpb24KKyAqICAgICAgICAgICAgICBmdW5jdGlvbiAgICAgICAgICAgIC0gQWRkcmVzcyBvZiB0aGUgZnVuY3Rpb24gdG8gZXhlY3V0ZQorICogICAgICAgICAgICAgIGNvbnRleHQgICAgICAgICAgICAgLSBQYXNzZWQgYXMgYSBwYXJhbWV0ZXIgdG8gdGhlIGZ1bmN0aW9uCisgKgorICogUkVUVVJOOiAgICAgIFN0YXR1cy4KKyAqCisgKiBERVNDUklQVElPTjogRXhlY3V0ZSBhIG5ldyB0aHJlYWQKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK2FjcGlfc3RhdHVzCithY3BpX29zX2V4ZWN1dGUoYWNwaV9leGVjdXRlX3R5cGUgdHlwZSwKKwkJYWNwaV9vc2RfZXhlY19jYWxsYmFjayBmdW5jdGlvbiwgdm9pZCAqY29udGV4dCkKK3sKKwlwdGhyZWFkX3QgdGhyZWFkOworCWludCByZXQ7CisKKwlyZXQgPQorCSAgICBwdGhyZWFkX2NyZWF0ZSgmdGhyZWFkLCBOVUxMLCAoUFRIUkVBRF9DQUxMQkFDSykgZnVuY3Rpb24sIGNvbnRleHQpOworCWlmIChyZXQpIHsKKwkJYWNwaV9vc19wcmludGYoIkNyZWF0ZSB0aHJlYWQgZmFpbGVkIik7CisJfQorCXJldHVybiAoMCk7Cit9CisKKyNlbHNlCQkJCS8qIEFDUElfU0lOR0xFX1RIUkVBREVEICovCithY3BpX3RocmVhZF9pZCBhY3BpX29zX2dldF90aHJlYWRfaWQodm9pZCkKK3sKKwlyZXR1cm4gKDEpOworfQorCithY3BpX3N0YXR1cworYWNwaV9vc19leGVjdXRlKGFjcGlfZXhlY3V0ZV90eXBlIHR5cGUsCisJCWFjcGlfb3NkX2V4ZWNfY2FsbGJhY2sgZnVuY3Rpb24sIHZvaWQgKmNvbnRleHQpCit7CisKKwlmdW5jdGlvbihjb250ZXh0KTsKKworCXJldHVybiAoQUVfT0spOworfQorCisjZW5kaWYJCQkJLyogQUNQSV9TSU5HTEVfVEhSRUFERUQgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIEZVTkNUSU9OOiAgICBhY3BpX29zX3dhaXRfZXZlbnRzX2NvbXBsZXRlCisgKgorICogUEFSQU1FVEVSUzogIE5vbmUKKyAqCisgKiBSRVRVUk46ICAgICAgTm9uZQorICoKKyAqIERFU0NSSVBUSU9OOiBXYWl0IGZvciBhbGwgYXN5bmNocm9ub3VzIGV2ZW50cyB0byBjb21wbGV0ZS4gVGhpcworICogICAgICAgICAgICAgIGltcGxlbWVudGF0aW9uIGRvZXMgbm90aGluZy4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3ZvaWQgYWNwaV9vc193YWl0X2V2ZW50c19jb21wbGV0ZSh2b2lkKQoreworCXJldHVybjsKK30KZGlmZiAtLWdpdCBhL3NyYy9rZXJuZWwvbGludXgvdjQuMTQvdG9vbHMvcG93ZXIvY3B1cG93ZXIvLmdpdGlnbm9yZSBiL3NyYy9rZXJuZWwvbGludXgvdjQuMTQvdG9vbHMvcG93ZXIvY3B1cG93ZXIvLmdpdGlnbm9yZQpuZXcgZmlsZSBtb2RlIDEwMD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YoIiAtbywgLS1vdXRwdXQ9PGRpcj5cdFx0XHRvdXRwdXQgcGF0aC4gRmlsZW5hbWUgd2lsbCBiZSBPVVRQVVRQQVRIL2JlbmNobWFya19USU1FU1RBTVAubG9nXG4iKTsKKwlwcmludGYoIiAtdiwgLS12ZXJib3NlXHRcdFx0XHR2ZXJib3NlIG91dHB1dCBvbi9vZmZcbiIpOworCXByaW50ZigiIC1oLCAtLWhlbHBcdFx0XHRcdFByaW50IHRoaXMgaGVscCBzY3JlZW5cbiIpOworCWV4aXQoMSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgbWFpbgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQoreworCWludCBjOworCWludCBvcHRpb25faW5kZXggPSAwOworCXN0cnVjdCBjb25maWcgKmNvbmZpZyA9IE5VTEw7CisKKwljb25maWcgPSBwcmVwYXJlX2RlZmF1bHRfY29uZmlnKCk7CisKKwlpZiAoY29uZmlnID09IE5VTEwpCisJCXJldHVybiBFWElUX0ZBSUxVUkU7CisKKwl3aGlsZSAoMSkgeworCQljID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsICJoZzpvOnM6bDp2YzpwOmY6bjpyOng6eToiLAorCQkJCWxvbmdfb3B0aW9ucywgJm9wdGlvbl9pbmRleCk7CisJCWlmIChjID09IC0xKQorCQkJYnJlYWs7CisKKwkJc3dpdGNoIChjKSB7CisJCWNhc2UgJ28nOgorCQkJaWYgKGNvbmZpZy0+b3V0cHV0ICE9IE5VTEwpCisJCQkJZmNsb3NlKGNvbmZpZy0+b3V0cHV0KTsKKworCQkJY29uZmlnLT5vdXRwdXQgPSBwcmVwYXJlX291dHB1dChvcHRhcmcpOworCisJCQlpZiAoY29uZmlnLT5v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mVlKGNvbmZpZyk7CisJCQl9CisJCQl1c2FnZSgpOworCQl9CisJfQorCisJaWYgKGNvbmZpZy0+dmVyYm9zZSkgeworCQlwcmludGYoInN0YXJ0aW5nIGJlbmNobWFyayB3aXRoIHBhcmFtZXRlcnM6XG4iKTsKKwkJcHJpbnRmKCJjb25maWc6XG5cdCIKKwkJICAgICAgICJzbGVlcD0lbGlcblx0IgorCQkgICAgICAgImxvYWQ9JWxpXG5cdCIKKwkJICAgICAgICJzbGVlcF9zdGVwPSVsaVxuXHQiCisJCSAgICAgICAibG9hZF9zdGVwPSVsaVxuXHQiCisJCSAgICAgICAiY3B1PSV1XG5cdCIKKwkJICAgICAgICJjeWNsZXM9JXVcblx0IgorCQkgICAgICAgInJvdW5kcz0ldVxuXHQiCisJCSAgICAgICAiZ292ZXJub3I9JXNcblxuIiwKKwkJICAgICAgIGNvbmZpZy0+c2xlZXAsCisJCSAgICAgICBjb25maWctPmxvYWQsCisJCSAgICAgICBjb25maWctPnNsZWVwX3N0ZXAsCisJCSAgICAgICBjb25maWctPmxvYWRfc3RlcCwKKwkJICAgICAgIGNvbmZpZy0+Y3B1LAorCQkgICAgICAgY29uZmlnLT5jeWNsZXMsCisJCSAgICAgICBjb25maWctPnJvdW5kcywKKwkJICAgICAgIGNvbmZpZy0+Z292ZXJub3IpOworCX0KKworCXByZXBhcmVfdXNlcihjb25maWcpOworCXByZXBhcmVfc3lzdGVtKGNvbmZpZyk7CisJc3RhcnRfYmVuY2htYXJrKGNvbmZpZyk7CisKKwlpZiAoY29uZmlnLT5vdXRwdXQgIT0gc3Rkb3V0KQorCQlmY2xvc2UoY29uZmlnLT5vdXRwdXQpOworCisJZnJlZShjb25maWcpOworCisJcmV0dXJuIEVYSVRfU1VDQ0VTUzsKK30KKwpkaWZmIC0tZ2l0IGEvc3JjL2tlcm5lbC9saW51eC92NC4xNC90b29scy9wb3dlci9jcHVwb3dlci9iZW5jaC9wYXJzZS5jIGIvc3JjL2tlcm5lbC9saW51eC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HVpbnQzMl90ICkodmFsICYgMHhmZmZmZmZmZnVsbCk7CisJKmhpID0gKHVpbnQzMl90ICkodmFsPj4zMiAmIDB4ZmZmZmZmZmZ1bGwpOworCisJcmV0dmFsID0gMDsKK2VycjI6CisJY2xvc2UoZmQpOworZXJyMToKKwlyZXR1cm4gcmV0dmFsOworfQorCitzdGF0aWMgdm9pZCBkZWNvZGUgKHVuc2lnbmVkIGludCBtc3IpCit7CisJdW5zaWduZWQgaW50IG11bHRpcGxpZXI7CisJdW5zaWduZWQgaW50IG12OworCisJbXVsdGlwbGllciA9ICgobXNyID4+IDgpICYgMHhGRik7CisKKwltdiA9ICgoKG1zciAmIDB4RkYpICogMTYpICsgNzAwKTsKKworCXByaW50ZigiMHgleCBtZWFucyBtdWx0aXBsaWVyICVkIEAgJWQgbVZcbiIsIG1zciwgbXVsdGlwbGllciwgbXYpOworfQorCitzdGF0aWMgaW50IGRlY29kZV9saXZlKHVuc2lnbmVkIGludCBjcHUpCit7CisJdW5zaWduZWQgaW50IGxvLCBoaTsKKwlpbnQgZXJyOworCisJZXJyID0gcmRtc3IoY3B1LCBNU1JfSUEzMl9QRVJGX1NUQVRVUywgJmxvLCAmaGkpOworCisJaWYgKGVycikgeworCQlwcmludGYoImNhbid0IGdldCBNU1JfSUEzMl9QRVJGX1NUQVRVUyBmb3IgY3B1ICVkXG4iLCBjcHUpOworCQlwcmludGYoIlBvc3NpYmxlIHRyb3VibGU6IHlvdSBkb24ndCBydW4gYW4gRW5oYW5jZWQgU3BlZWRTdGVwIGNhcGFibGUgY3B1XG4iKTsKKwkJcHJpbnRmKCJvciB5b3UgYXJlIG5vdCByb290LCBvciB0aGUgbXNyIGRyaXZlciBpcyBub3QgcHJlc2VudFxuIik7CisJCXJldHVybiAxOworCX0KKworCWRlY29kZShsbyk7CisKKwlyZXR1cm4gMDsKK30KKworaW50IG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKwl1bnNpZ25lZCBpbnQgY3B1LCBtb2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ByaW50ZiAoIlVzYWdlOiBkdW1wX3BzYiBbb3B0aW9uc11cbiIpOworCXByaW50ZiAoIk9wdGlvbnM6XG4iKTsKKwlwcmludGYgKCIgIC1uLCAtLW51bXBzdCAgICAgU2V0IG51bWJlciBvZiBQU1QgdGFibGVzIHRvIHNjYW5cbiIpOworCXByaW50ZiAoIiAgLXIsIC0tcmVsZXZhbnQgICBPbmx5IGRpc3BsYXkgUFNUcyByZWxldmFudCB0byBjcHVpZCBOXG4iKTsKK30KKworaW50CittYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJaW50IGZkOworCWludCBudW1wc3Q9LTE7CisJaW50IHJldD0wLCBjb250PTE7CisJY2hhciAqbWVtID0gTlVMTDsKKwljaGFyICpwOworCisJZG8geworCQlyZXQgPSBnZXRvcHRfbG9uZyhhcmdjLCBhcmd2LCAiaHI6bjoiLCBpbmZvX29wdHMsIE5VTEwpOworCQlzd2l0Y2ggKHJldCl7CisJCWNhc2UgJz8nOgorCQljYXNlICdoJzoKKwkJCXByaW50X2hlbHAoKTsKKwkJCWNvbnQgPSAwOworCQkJYnJlYWs7CisJCWNhc2UgJ3InOgorCQkJcmVsZXZhbnQgPSBzdHJ0b2wob3B0YXJnLCBOVUxMLCAxNik7CisJCQlicmVhazsKKwkJY2FzZSAnbic6CisJCQludW1wc3QgPSBzdHJ0b2wob3B0YXJnLCBOVUxMLCAxMCk7CisJCQlicmVhazsKKwkJY2FzZSAtMToKKwkJCWNvbnQgPSAwOworCQkJYnJlYWs7CisJCX0KKworCX0gd2hpbGUoY29udCk7CisKKwlmZCA9IG9wZW4oIi9kZXYvbWVtIiwgT19SRE9OTFkpOworCWlmIChmZCA8IDApIHsKKwkJcHJpbnRmICgiQ291bGRuJ3Qgb3BlbiAvZGV2L21lbS4gQXJlIHlvdSByb290P1xuIik7CisJCWV4aXQoMSk7CisJfQorCisJbWVtID0gbW1hcChtZW0sIDB4MTAwMDAwIC0gMHhjMDAwMCwgUFJPVF9SRUFELCB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CisJCQl9CisJCX0KKwkJaWYgKCEoYSA8PSBiKSkKKwkJCWdvdG8gZXJyOworCQlpZiAoYiA+PSBibXAtPnNpemUpCisJCQlnb3RvIGVycjsKKwkJd2hpbGUgKGEgPD0gYikgeworCQkJX3NldGJpdChibXAsIGEsIDEpOworCQkJYSArPSBzOworCQl9CisJfQorCXJldHVybiAwOworZXJyOgorCWJpdG1hc2tfY2xlYXJhbGwoYm1wKTsKKwlyZXR1cm4gLTE7Cit9CisKKy8qCisgKiBlbWl0KGJ1ZiwgYnVmbGVuLCByYm90LCBydG9wLCBsZW4pCisgKgorICogSGVscGVyIHJvdXRpbmUgZm9yIGJpdG1hc2tfZGlzcGxheWxpc3QoKS4gIFdyaXRlIGRlY2ltYWwgbnVtYmVyCisgKiBvciByYW5nZSB0byBidWYrbGVuLCBzdXBwcmVzc2luZyBvdXRwdXQgcGFzdCBidWYrYnVmbGVuLCB3aXRoIG9wdGlvbmFsCisgKiBjb21tYS1wcmVmaXguICBSZXR1cm4gbGVuIG9mIHdoYXQgd291bGQgYmUgd3JpdHRlbiB0byBidWYsIGlmIGl0CisgKiBhbGwgZml0LgorICovCisKK3N0YXRpYyBpbmxpbmUgaW50IGVtaXQoY2hhciAqYnVmLCBpbnQgYnVmbGVuLCBpbnQgcmJvdCwgaW50IHJ0b3AsIGludCBsZW4pCit7CisJaWYgKGxlbiA+IDApCisJCWxlbiArPSBzbnByaW50ZihidWYgKyBsZW4sIG1heChidWZsZW4gLSBsZW4sIDApLCAiLCIpOworCWlmIChyYm90ID09IHJ0b3ApCisJCWxlbiArPSBzbnByaW50ZihidWYgKyBsZW4sIG1heChidWZsZW4gLSBsZW4sIDApLCAiJWQiLCByYm90KTsKKwllbHNlCisJCWxlbiArPSBzbnByaW50ZihidWYgKyBsZW4sIG1heChidWZsZW4gLSBsZW4sIDApLCAiJWQtJWQiLAorCQkJCXJib3QsIHJ0b3ApOworCXJldHVybiBsZW47Cit9CisKKy8qCisgKiBXcml0ZSBkZWNpb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ZpbGUgaXMgbm90IHJlYWRhYmxlOiAlcycgJSBzeXN2YWxzLm1lbXBhdGgpCisJCXJldHVybiBGYWxzZQorCisJZnAgPSBvcGVuKHN5c3ZhbHMuZnBkdHBhdGgsICdyYicpCisJYnVmID0gZnAucmVhZCgpCisJZnAuY2xvc2UoKQorCisJaWYobGVuKGJ1ZikgPCAzNik6CisJCWlmKG91dHB1dCk6CisJCQlkb0Vycm9yKCdJbnZhbGlkIEZQRFQgdGFibGUgZGF0YSwgc2hvdWxkICcrXAorCQkJCSdiZSBhdCBsZWFzdCAzNiBieXRlcycpCisJCXJldHVybiBGYWxzZQorCisJdGFibGUgPSBzdHJ1Y3QudW5wYWNrKCc0c0lCQjZzOHNJNHNJJywgYnVmWzA6MzZdKQorCWlmKG91dHB1dCk6CisJCXByaW50KCcnKQorCQlwcmludCgnRmlybXdhcmUgUGVyZm9ybWFuY2UgRGF0YSBUYWJsZSAoJXMpJyAlIHRhYmxlWzBdKQorCQlwcmludCgnICAgICAgICAgICAgICAgICAgU2lnbmF0dXJlIDogJXMnICUgdGFibGVbMF0pCisJCXByaW50KCcgICAgICAgICAgICAgICBUYWJsZSBMZW5ndGggOiAldScgJSB0YWJsZVsxXSkKKwkJcHJpbnQoJyAgICAgICAgICAgICAgICAgICBSZXZpc2lvbiA6ICV1JyAlIHRhYmxlWzJdKQorCQlwcmludCgnICAgICAgICAgICAgICAgICAgIENoZWNrc3VtIDogMHgleCcgJSB0YWJsZVszXSkKKwkJcHJpbnQoJyAgICAgICAgICAgICAgICAgICAgIE9FTSBJRCA6ICVzJyAlIHRhYmxlWzRdKQorCQlwcmludCgnICAgICAgICAgICAgICAgT0VNIFRhYmxlIElEIDogJXMnICUgdGFibGVbNV0pCisJCXByaW50KCcgICAgICAgICAgICAgICBPRU0gUmV2aXNpb24gOiAldScgJSB0YWJsZVs2XSkKKwkJcHJpbnQoJyAgICAgICAgICAgICAgICAgQ3JlYXRvciBJRCA6ICVzJyAlIHRhYmxlWzddKQorCQ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y9mdHJhY2Ugb3V0cHV0IGFzIGFuIGh0bWwgdGltZWxpbmUuJykKKwlwcmludCgnJykKKwlwcmludCgnICBHZW5lcmF0ZXMgb3V0cHV0IGZpbGVzIGluIHN1YmRpcmVjdG9yeTogc3VzcGVuZC15eW1tZGQtSEhNTVNTJykKKwlwcmludCgnICAgSFRNTCBvdXRwdXQ6ICAgICAgICAgICAgICAgICAgICA8aG9zdG5hbWU+Xzxtb2RlPi5odG1sJykKKwlwcmludCgnICAgcmF3IGRtZXNnIG91dHB1dDogICAgICAgICAgICAgICA8aG9zdG5hbWU+Xzxtb2RlPl9kbWVzZy50eHQnKQorCXByaW50KCcgICByYXcgZnRyYWNlIG91dHB1dDogICAgICAgICAgICAgIDxob3N0bmFtZT5fPG1vZGU+X2Z0cmFjZS50eHQnKQorCXByaW50KCcnKQorCXByaW50KCdPcHRpb25zOicpCisJcHJpbnQoJyAgIC1oICAgICAgICAgICBQcmludCB0aGlzIGhlbHAgdGV4dCcpCisJcHJpbnQoJyAgIC12ICAgICAgICAgICBQcmludCB0aGUgY3VycmVudCB0b29sIHZlcnNpb24nKQorCXByaW50KCcgICAtY29uZmlnIGZuICAgUHVsbCBhcmd1bWVudHMgYW5kIGNvbmZpZyBvcHRpb25zIGZyb20gZmlsZSBmbicpCisJcHJpbnQoJyAgIC12ZXJib3NlICAgICBQcmludCBleHRyYSBpbmZvcm1hdGlvbiBkdXJpbmcgZXhlY3V0aW9uIGFuZCBhbmFseXNpcycpCisJcHJpbnQoJyAgIC1tIG1vZGUgICAgICBNb2RlIHRvIGluaXRpYXRlIGZvciBzdXNwZW5kIChkZWZhdWx0OiAlcyknKSAlIChzeXN2YWxzLnN1c3BlbmRtb2RlKQorCXByaW50KCcgICAtbyBuYW1lICAgICAgT3ZlcnJpZGVzIHRoZSBvdXRwdXQgc3ViZGlyZWN0b3J5IG5hbWUgd2hlbiBydW5uaW5nIGEgbmV3IHRlc3QnKQorCXByaW50KCcgICAgICAgICAgICAgICAgZGVmY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mxlIHRyYWNlICIiIgorCisgICAgdHJ5OgorICAgICAgIG9wZW4oJy9zeXMva2VybmVsL2RlYnVnL3RyYWNpbmcvZXZlbnRzL3Bvd2VyL3BzdGF0ZV9zYW1wbGUvZW5hYmxlJworICAgICAgICAgICAgICAgICAsICd3Jykud3JpdGUoIjAiKQorICAgIGV4Y2VwdDoKKyAgICAgICAgcHJpbnQoJ0lPIGVycm9yIGRpc2FibGluZyB0cmFjZSAnKQorICAgICAgICBxdWl0KCkKKworZGVmIHNldF90cmFjZV9idWZmZXJfc2l6ZSgpOgorICAgICIiIiBTZXQgdHJhY2UgYnVmZmVyIHNpemUgIiIiCisKKyAgICB0cnk6CisgICAgICAgb3BlbignL3N5cy9rZXJuZWwvZGVidWcvdHJhY2luZy9idWZmZXJfc2l6ZV9rYicKKyAgICAgICAgICAgICAgICAgLCAndycpLndyaXRlKCIxMDI0MCIpCisgICAgZXhjZXB0OgorICAgICAgICBwcmludCgnSU8gZXJyb3Igc2V0dGluZyB0cmFjZSBidWZmZXIgc2l6ZSAnKQorICAgICAgICBxdWl0KCkKKworZGVmIHJlYWRfdHJhY2VfZGF0YShmaWxlbmFtZSk6CisgICAgIiIiIFJlYWQgYW5kIHBhcnNlIHRyYWNlIGRhdGEgIiIiCisKKyAgICBnbG9iYWwgY3VycmVudF9tYXhfY3B1CisgICAgZ2xvYmFsIHNhbXBsZV9udW0sIGxhc3Rfc2VjX2NwdSwgbGFzdF91c2VjX2NwdSwgc3RhcnRfdGltZQorCisgICAgdHJ5OgorICAgICAgICBkYXRhID0gb3BlbihmaWxlbmFtZSwgJ3InKS5yZWFkKCkKKyAgICBleGNlcHQ6CisgICAgICAgIHByaW50KCdFcnJvciBvcGVuaW5nICcsIGZpbGVuYW1lKQorICAgICAgICBxdWl0KCkKKworICAgIGZvciBsaW5lIGluIGRhdGEuc3BsaXRsaW5lcygpOgorICAgICAgICBzZWFyY2hfb2JqID0gXAorICAgICAgICAgICAgcmUuc2VhcmNoKHInKF4oLio/KVxbKSgoXGQrKVteXF1dKSguKj8pKFxkKykoWy5dKShcZCspKC4qP2NvcmVfYnVzeT0pKFxkKykoLio/c2NhbGVkPSkoXGQrKSguKj9mcm9tPSkoXGQrKSguKj90bz0pKFxkKykoLio/bXBlcmY9KShcZCspKC4qP2FwZXJmPSkoXGQrKSguKj90c2M9KShcZCspKC4qP2ZyZXE9KShcZCspJworICAgICAgICAgICAgICAgICAgICAgICwgbGluZSkKKworICAgICAgICBpZiBzZWFyY2hfb2JqOgorICAgICAgICAgICAgY3B1ID0gc2VhcmNoX29iai5ncm91cCgzKQorICAgICAgICAgICAgY3B1X2ludCA9IGludChjcHUpCisgICAgICAgICAgICBjcHUgPSBzdHIoY3B1X2ludCkKKworICAgICAgICAgICAgdGltZV9wcmVfZGVjID0gc2VhcmNoX29iai5ncm91cCg2KQorICAgICAgICAgICAgdGltZV9wb3N0X2RlYyA9IHNlYXJjaF9vYmouZ3JvdXAoOCkKKyAgICAgICAgICAgIGNvcmVfYnVzeSA9IHNlYXJjaF9vYmouZ3JvdXAoMTApCisgICAgICAgICAgICBzY2FsZWQgPSBzZWFyY2hfb2JqLmdyb3VwKDEyKQorICAgICAgICAgICAgX2Zyb20gPSBzZWFyY2hfb2JqLmdyb3VwKDE0KQorICAgICAgICAgICAgX3RvID0gc2VhcmNoX29iai5ncm91cCgxNikKKyAgICAgICAgICAgIG1wZXJmID0gc2VhcmNoX29iai5ncm91cCgxOCkKKyAgICAgICAgICAgIGFwZXJmID0gc2VhcmNoX29iai5ncm91cCgyMCkKKyAgICAgICAgICAgIHRzYyA9IHNlYXJjaF9vYmouZ3JvdXAoMjIpCisgICAgICAgICAgICBmcmVxID0gc2VhcmNoX29iai5ncm91cCgyNCkKKyAgICAgICAgICAgIGNvbW1vbl9jb21tID0gc2VhcmNoX29iai5ncm91cCgyKS5yZXBsYWNlKCcgJywgJycpCisKKyAgICAgICAgICAgICMgTm90IGFsbCBrZXJuZWwgdmVyc2lvbnMgaGF2ZSBpb19ib29zdCBmaWVsZAorICAgICAgICAgICAgaW9fYm9vc3QgPSAnMCcKKyAgICAgICAgICAgIHNlYXJjaF9vYmogPSByZS5zZWFyY2gocicuKj9pb19ib29zdD0oXGQrKScsIGxpbmUpCisgICAgICAgICAgICBpZiBzZWFyY2hfb2JqOgorICAgICAgICAgICAgICAgIGlvX2Jvb3N0ID0gc2VhcmNoX29iai5ncm91cCgxKQorCisgICAgICAgICAgICBpZiBzYW1wbGVfbnVtID09IDAgOgorICAgICAgICAgICAgICAgIHN0YXJ0X3RpbWUgPSBEZWNpbWFsKHRpbWVfcHJlX2RlYykgKyBEZWNpbWFsKHRpbWVfcG9zdF9kZWMpIC8gRGVjaW1hbCgxMDAwMDAwKQorICAgICAgICAgICAgc2FtcGxlX251bSArPSAxCisKKyAgICAgICAgICAgIGlmIGxhc3Rfc2VjX2NwdVtjcHVfaW50XSA9PSAwIDoKKyAgICAgICAgICAgICAgICBsYXN0X3NlY19jcHVbY3B1X2ludF0gPSB0aW1lX3ByZV9kZWMKKyAgICAgICAgICAgICAgICBsYXN0X3VzZWNfY3B1W2NwdV9pbnRdID0gdGltZV9wb3N0X2RlYworICAgICAgICAgICAgZWxzZSA6CisgICAgICAgICAgICAgICAgZHVyYXRpb25fdXMgPSAoaW50KHRpbWVfcHJlX2RlYykgLSBpbnQobGFzdF9zZWNfY3B1W2NwdV9pbnRdKSkgKiAxMDAwMDAwICsgKGludCh0aW1lX3Bvc3RfZGVjKSAtIGludChsYXN0X3VzZWNfY3B1W2NwdV9pbnRdKSkKKyAgICAgICAgICAgICAgICBkdXJhdGlvbl9tcyA9IERlY2ltYWwoZHVyYXRpb25fdXMpIC8gRGVjaW1hbCgxMDAwKQorICAgICAgICAgICAgICAgIGxhc3Rfc2VjX2NwdVtjcHVfaW50XSA9IHRpbWVfcHJlX2RlYworICAgICAgICAgICAgICAgIGxhc3RfdXNlY19jcHVbY3B1X2ludF0gPSB0aW1lX3Bvc3RfZGVjCisgICAgICAgICAgICAgICAgZ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z0gc3ByaW50ZihvdXRwLCAiJXNDUFUiLCAocHJpbnRlZCsrID8gZGVsaW0gOiAiIikpOworCWlmIChET19CSUMoQklDX0F2Z19NSHopKQorCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzQXZnX01IeiIsIChwcmludGVkKysgPyBkZWxpbSA6ICIiKSk7CisJaWYgKERPX0JJQyhCSUNfQnVzeSkpCisJCW91dHAgKz0gc3ByaW50ZihvdXRwLCAiJXNCdXN5JSUiLCAocHJpbnRlZCsrID8gZGVsaW0gOiAiIikpOworCWlmIChET19CSUMoQklDX0J6eV9NSHopKQorCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzQnp5X01IeiIsIChwcmludGVkKysgPyBkZWxpbSA6ICIiKSk7CisJaWYgKERPX0JJQyhCSUNfVFNDX01IeikpCisJCW91dHAgKz0gc3ByaW50ZihvdXRwLCAiJXNUU0NfTUh6IiwgKHByaW50ZWQrKyA/IGRlbGltIDogIiIpKTsKKworCWlmIChET19CSUMoQklDX0lSUSkpIHsKKwkJaWYgKHN1bXNfbmVlZF93aWRlX2NvbHVtbnMpCisJCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzICAgICBJUlEiLCAocHJpbnRlZCsrID8gZGVsaW0gOiAiIikpOworCQllbHNlCisJCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzSVJRIiwgKHByaW50ZWQrKyA/IGRlbGltIDogIiIpKTsKKwl9CisKKwlpZiAoRE9fQklDKEJJQ19TTUkpKQorCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzU01JIiwgKHByaW50ZWQrKyA/IGRlbGltIDogIiIpKTsKKworCWZvciAobXAgPSBzeXMudHA7IG1wOyBtcCA9IG1wLT5uZXh0KSB7CisKKwkJaWYgKG1wLT5mb3JtYXQgPT0gRk9STUFUX1JBVykgeworCQkJaWYgKG1wLT53aWR0aCA9PSA2NCkKKwkJCQlvdXRwICs9IHNwcmludGYob3V0cCwgIiVzJTE4LjE4cyIsIChwcmludG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IlBLR19NSU5fUFdSX0xWTDI9JWQgIiwgKHVuc2lnbmVkIGludCkobXNyID4+IDQ4KSAmIDB4N0ZGRik7CisJCWZwcmludGYob3V0ZiwgIlBLR19NQVhfUFdSX0xWTDI9JWQgIiwgKHVuc2lnbmVkIGludCkobXNyID4+IDMyKSAmIDB4N0ZGRik7CisJCWZwcmludGYob3V0ZiwgIkxWTDJfUkFUSU89JWQgIiwgKHVuc2lnbmVkIGludCkobXNyID4+IDE2KSAmIDB4RkYpOworCQlmcHJpbnRmKG91dGYsICJQS0dfVERQX0xWTDI9JWQiLCAodW5zaWduZWQgaW50KShtc3IpICYgMHg3RkZGKTsKKwl9CisJZnByaW50ZihvdXRmLCAiKVxuIik7CisKKwlnZXRfbXNyKGJhc2VfY3B1LCBNU1JfQ09ORklHX1REUF9DT05UUk9MLCAmbXNyKTsKKwlmcHJpbnRmKG91dGYsICJjcHUlZDogTVNSX0NPTkZJR19URFBfQ09OVFJPTDogMHglMDhsbHggKCIsIGJhc2VfY3B1LCBtc3IpOworCWlmICgobXNyKSAmIDB4MykKKwkJZnByaW50ZihvdXRmLCAiVERQX0xFVkVMPSVkICIsICh1bnNpZ25lZCBpbnQpKG1zcikgJiAweDMpOworCWZwcmludGYob3V0ZiwgIiBsb2NrPSVkIiwgKHVuc2lnbmVkIGludCkobXNyID4+IDMxKSAmIDEpOworCWZwcmludGYob3V0ZiwgIilcbiIpOworCisJZ2V0X21zcihiYXNlX2NwdSwgTVNSX1RVUkJPX0FDVElWQVRJT05fUkFUSU8sICZtc3IpOworCWZwcmludGYob3V0ZiwgImNwdSVkOiBNU1JfVFVSQk9fQUNUSVZBVElPTl9SQVRJTzogMHglMDhsbHggKCIsIGJhc2VfY3B1LCBtc3IpOworCWZwcmludGYob3V0ZiwgIk1BWF9OT05fVFVSQk9fUkFUSU89JWQiLCAodW5zaWduZWQgaW50KShtc3IpICYgMHhGRik7CisJZnByaW50ZihvdXRmLCAiIGxvY2s9JWQiLCAodW5zaWduZWQg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2MvaW50ZXJydXB0cyB0byBnZXQgY3B1KiBuYW1lIGZvciBlYWNoIGNvbHVtbiAqLworCWZvciAoY29sdW1uID0gMDsgY29sdW1uIDwgdG9wby5udW1fY3B1czsgKytjb2x1bW4pIHsKKwkJaW50IGNwdV9udW1iZXI7CisKKwkJcmV0dmFsID0gZnNjYW5mKGZwLCAiIENQVSVkIiwgJmNwdV9udW1iZXIpOworCQlpZiAocmV0dmFsICE9IDEpCisJCQlicmVhazsKKworCQlpZiAoY3B1X251bWJlciA+IHRvcG8ubWF4X2NwdV9udW0pIHsKKwkJCXdhcm4oIi9wcm9jL2ludGVycnVwdHM6IGNwdSVkOiA+ICVkIiwgY3B1X251bWJlciwgdG9wby5tYXhfY3B1X251bSk7CisJCQlyZXR1cm4gMTsKKwkJfQorCisJCWlycV9jb2x1bW5fMl9jcHVbY29sdW1uXSA9IGNwdV9udW1iZXI7CisJCWlycXNfcGVyX2NwdVtjcHVfbnVtYmVyXSA9IDA7CisJfQorCisJLyogcmVhZCAvcHJvYy9pbnRlcnJ1cHQgY291bnQgbGluZXMgYW5kIHN1bSB1cCBpcnFzIHBlciBjcHUgKi8KKwl3aGlsZSAoMSkgeworCQlpbnQgY29sdW1uOworCQljaGFyIGJ1Zls2NF07CisKKwkJcmV0dmFsID0gZnNjYW5mKGZwLCAiICVzOiIsIGJ1Zik7CS8qIGZsdXNoIGlycSMgIk46IiAqLworCQlpZiAocmV0dmFsICE9IDEpCisJCQlicmVhazsKKworCQkvKiByZWFkIHRoZSBjb3VudCBwZXIgY3B1ICovCisJCWZvciAoY29sdW1uID0gMDsgY29sdW1uIDwgdG9wby5udW1fY3B1czsgKytjb2x1bW4pIHsKKworCQkJaW50IGNwdV9udW1iZXIsIGlycV9jb3VudDsKKworCQkJcmV0dmFsID0gZnNjYW5mKGZwLCAiICVkIiwgJmlycV9jb3VudCk7CisJCQlpZiAocmV0dmFsICE9IDEpCisJCQkJYnJlYWs7CisKKwkJCWNwdV9udW1iZXIgPSBpc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isJCXJldHVybiAtMTsKKworCWZwcmludGYob3V0ZiwgImNwdSVkOiBNU1JfUkFQTF9QT1dFUl9VTklUOiAweCUwOGxseCAoJWYgV2F0dHMsICVmIEpvdWxlcywgJWYgc2VjLilcbiIsIGNwdSwgbXNyLAorCQlyYXBsX3Bvd2VyX3VuaXRzLCByYXBsX2VuZXJneV91bml0cywgcmFwbF90aW1lX3VuaXRzKTsKKworCWlmIChkb19yYXBsICYgUkFQTF9QS0dfUE9XRVJfSU5GTykgeworCisJCWlmIChnZXRfbXNyKGNwdSwgTVNSX1BLR19QT1dFUl9JTkZPLCAmbXNyKSkKKyAgICAgICAgICAgICAgICAJcmV0dXJuIC01OworCisKKwkJZnByaW50ZihvdXRmLCAiY3B1JWQ6IE1TUl9QS0dfUE9XRVJfSU5GTzogMHglMDhsbHggKCUuMGYgVyBURFAsIFJBUEwgJS4wZiAtICUuMGYgVywgJWYgc2VjLilcbiIsCisJCQljcHUsIG1zciwKKwkJCSgobXNyID4+ICAwKSAmIFJBUExfUE9XRVJfR1JBTlVMQVJJVFkpICogcmFwbF9wb3dlcl91bml0cywKKwkJCSgobXNyID4+IDE2KSAmIFJBUExfUE9XRVJfR1JBTlVMQVJJVFkpICogcmFwbF9wb3dlcl91bml0cywKKwkJCSgobXNyID4+IDMyKSAmIFJBUExfUE9XRVJfR1JBTlVMQVJJVFkpICogcmFwbF9wb3dlcl91bml0cywKKwkJCSgobXNyID4+IDQ4KSAmIFJBUExfVElNRV9HUkFOVUxBUklUWSkgKiByYXBsX3RpbWVfdW5pdHMpOworCisJfQorCWlmIChkb19yYXBsICYgUkFQTF9QS0cpIHsKKworCQlpZiAoZ2V0X21zcihjcHUsIE1TUl9QS0dfUE9XRVJfTElNSVQsICZtc3IpKQorCQkJcmV0dXJuIC05OworCisJCWZwcmludGYob3V0ZiwgImNwdSVkOiBNU1JfUEtHX1BPV0VSX0xJTUlUOiAweCUwOGxseCAoJXNsb2NrZWQpXG4iLAorCQkJY3B1LCBtc3Is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CisJCQlmcHJpbnRmKHN0ZGVyciwgImV4Y2VlZGVkIG1heCAlZCBhZGRlZCB0aHJlYWQgY291bnRlcnNcbiIsCisJCQkJTUFYX0FEREVEX0NPVU5URVJTKTsKKwkJCWV4aXQoLTEpOworCQl9CisJCWJyZWFrOworCisJY2FzZSBTQ09QRV9DT1JFOgorCQltc3JwLT5uZXh0ID0gc3lzLmNwOworCQlzeXMuY3AgPSBtc3JwOworCQlzeXMuYWRkZWRfY29yZV9jb3VudGVycysrOworCQlpZiAoc3lzLmFkZGVkX2NvcmVfY291bnRlcnMgPiBNQVhfQURERURfQ09VTlRFUlMpIHsKKwkJCWZwcmludGYoc3RkZXJyLCAiZXhjZWVkZWQgbWF4ICVkIGFkZGVkIGNvcmUgY291bnRlcnNcbiIsCisJCQkJTUFYX0FEREVEX0NPVU5URVJTKTsKKwkJCWV4aXQoLTEpOworCQl9CisJCWJyZWFrOworCisJY2FzZSBTQ09QRV9QQUNLQUdFOgorCQltc3JwLT5uZXh0ID0gc3lzLnBwOworCQlzeXMucHAgPSBtc3JwOworCQlzeXMuYWRkZWRfcGFja2FnZV9jb3VudGVycysrOworCQlpZiAoc3lzLmFkZGVkX3BhY2thZ2VfY291bnRlcnMgPiBNQVhfQURERURfQ09VTlRFUlMpIHsKKwkJCWZwcmludGYoc3RkZXJyLCAiZXhjZWVkZWQgbWF4ICVkIGFkZGVkIHBhY2thZ2UgY291bnRlcnNcbiIsCisJCQkJTUFYX0FEREVEX0NPVU5URVJTKTsKKwkJCWV4aXQoLTEpOworCQl9CisJCWJyZWFrOworCX0KKworCXJldHVybiAwOworfQorCit2b2lkIHBhcnNlX2FkZF9jb21tYW5kKGNoYXIgKmFkZF9jb21tYW5kKQoreworCWludCBtc3JfbnVtID0gMDsKKwljaGFyICpwYXRoID0gTlVMTDsKKwljaGFyIG5hbWVfYnVmZmVyW05BTUVfQllURVNdID0gIiI7CisJaW50IHdpZHRoID0gNjQ7CisJaW50IGZhaWwgPSAwOworCWVudW0g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