mirror of
https://codeberg.org/kiss-community/repo
synced 2024-08-23 14:26:18 +00:00
1 line
52 KiB
Diff
1 line
52 KiB
Diff
ZGlmZiAtLWdpdCBhL2NyYzMyLmMgYi9jcmMzMi5jCmluZGV4IDk1ODA0NDBjMGU2Yi4uOTE2MjQyOWNjN2I0IDEwMDY0NAotLS0gYS9jcmMzMi5jCisrKyBiL2NyYzMyLmMKQEAgLTI4LDYgKzI4LDggQEAKICMgIGVuZGlmIC8qICFEWU5BTUlDX0NSQ19UQUJMRSAqLwogI2VuZGlmIC8qIE1BS0VDUkNIICovCiAKKyNpbmNsdWRlICJkZWZsYXRlLmgiCisjaW5jbHVkZSAieDg2LmgiCiAjaW5jbHVkZSAienV0aWwuaCIgICAgICAvKiBmb3IgU1REQyBhbmQgRkFSIGRlZmluaXRpb25zICovCiAKIC8qIERlZmluaXRpb25zIGZvciBkb2luZyB0aGUgY3JjIGZvdXIgZGF0YSBieXRlcyBhdCBhIHRpbWUuICovCkBAIC00NDAsMyArNDQyLDI4IEBAIHVMb25nIFpFWFBPUlQgY3JjMzJfY29tYmluZTY0KGNyYzEsIGNyYzIsIGxlbjIpCiB7CiAgICAgcmV0dXJuIGNyYzMyX2NvbWJpbmVfKGNyYzEsIGNyYzIsIGxlbjIpOwogfQorCitaTElCX0lOVEVSTkFMIHZvaWQgY3JjX3Jlc2V0KGRlZmxhdGVfc3RhdGUgKmNvbnN0IHMpCit7CisgICAgaWYgKHg4Nl9jcHVfZW5hYmxlX3NpbWQpIHsKKyAgICAgICAgY3JjX2ZvbGRfaW5pdChzKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBzLT5zdHJtLT5hZGxlciA9IGNyYzMyKDBMLCBaX05VTEwsIDApOworfQorCitaTElCX0lOVEVSTkFMIHZvaWQgY3JjX2ZpbmFsaXplKGRlZmxhdGVfc3RhdGUgKmNvbnN0IHMpCit7CisgICAgaWYgKHg4Nl9jcHVfZW5hYmxlX3NpbWQpCisgICAgICAgIHMtPnN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KSB7CisgICAgICAgIGlmIChsZW4gPT0gMCkKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgZ290byBwYXJ0aWFsOworICAgIH0KKworICAgIGFsZ25fZGlmZiA9IDAgLSAodWludHB0cl90KXNyYyAmIDB4RjsKKyAgICBpZiAoYWxnbl9kaWZmKSB7CisgICAgICAgIHhtbV9jcmNfcGFydCA9IF9tbV9sb2FkdV9zaTEyOCgoX19tMTI4aSAqKXNyYyk7CisgICAgICAgIF9tbV9zdG9yZXVfc2kxMjgoKF9fbTEyOGkgKilkc3QsIHhtbV9jcmNfcGFydCk7CisKKyAgICAgICAgZHN0ICs9IGFsZ25fZGlmZjsKKyAgICAgICAgc3JjICs9IGFsZ25fZGlmZjsKKyAgICAgICAgbGVuIC09IGFsZ25fZGlmZjsKKworICAgICAgICBwYXJ0aWFsX2ZvbGQocywgYWxnbl9kaWZmLCAmeG1tX2NyYzAsICZ4bW1fY3JjMSwgJnhtbV9jcmMyLCAmeG1tX2NyYzMsCisgICAgICAgICAgICAmeG1tX2NyY19wYXJ0KTsKKyAgICB9CisKKyAgICB3aGlsZSAoKGxlbiAtPSA2NCkgPj0gMCkgeworICAgICAgICB4bW1fdDAgPSBfbW1fbG9hZF9zaTEyOCgoX19tMTI4aSAqKXNyYyk7CisgICAgICAgIHhtbV90MSA9IF9tbV9sb2FkX3NpMTI4KChfX20xMjhpICopc3JjICsgMSk7CisgICAgICAgIHhtbV90MiA9IF9tbV9sb2FkX3NpMTI4KChfX20xMjhpICopc3JjICsgMik7CisgICAgICAgIHhtbV90MyA9IF9tbV9sb2FkX3NpMTI4KChfX20xMjhpICopc3JjICsgMyk7CisKKyAgICAgICAgZm9sZF80KHMsICZ4bW1fY3JjMCwgJnhtbV9jcmMxLCAmeG1tX2NyYzIsICZ4bW1fY3JjMyk7CisKKyAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKWRzdCwgeG1tX3QwKTsKKyAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKWRzdCArIDEsIHhtbV90MSk7CisgICAgICAgIF9tbV9zdG9yZXVfc2kxMjgoKF9fbTEyOGkgKilkc3QgKyAyLCB4bW1fdDIpOworICAgICAgICBfbW1fc3RvcmV1X3NpMTI4KChfX20xMjhpICopZHN0ICsgMywgeG1tX3QzKTsKKworICAgICAgICB4bW1fY3JjMCA9IF9tbV94b3Jfc2kxMjgoeG1tX2NyYzAsIHhtbV90MCk7CisgICAgICAgIHhtbV9jcmMxID0gX21tX3hvcl9zaTEyOCh4bW1fY3JjMSwgeG1tX3QxKTsKKyAgICAgICAgeG1tX2NyYzIgPSBfbW1feG9yX3NpMTI4KHhtbV9jcmMyLCB4bW1fdDIpOworICAgICAgICB4bW1fY3JjMyA9IF9tbV94b3Jfc2kxMjgoeG1tX2NyYzMsIHhtbV90Myk7CisKKyAgICAgICAgc3JjICs9IDY0OworICAgICAgICBkc3QgKz0gNjQ7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBsZW4gPSBudW0gYnl0ZXMgbGVmdCAtIDY0CisgICAgICovCisgICAgaWYgKGxlbiArIDE2ID49IDApIHsKKyAgICAgICAgbGVuICs9IDE2OworCisgICAgICAgIHhtbV90MCA9IF9tbV9sb2FkX3NpMTI4KChfX20xMjhpICopc3JjKTsKKyAgICAgICAgeG1tX3QxID0gX21tX2xvYWRfc2kxMjgoKF9fbTEyOGkgKilzcmMgKyAxKTsKKyAgICAgICAgeG1tX3QyID0gX21tX2xvYWRfc2kxMjgoKF9fbTEyOGkgKilzcmMgKyAyKTsKKworICAgICAgICBmb2xkXzMocywgJnhtbV9jcmMwLCAmeG1tX2NyYzEsICZ4bW1fY3JjMiwgJnhtbV9jcmMzKTsKKworICAgICAgICBfbW1fc3RvcmV1X3NpMTI4KChfX20xMjhpICopZHN0LCB4bW1fdDApOworICAgICAgICBfbW1fc3RvcmV1X3NpMTI4KChfX20xMjhpICopZHN0ICsgMSwgeG1tX3QxKTsKKyAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKWRzdCArIDIsIHhtbV90Mik7CisKKyAgICAgICAgeG1tX2NyYzEgPSBfbW1feG9yX3NpMTI4KHhtbV9jcmMxLCB4bW1fdDApOworICAgICAgICB4bW1fY3JjMiA9IF9tbV94b3Jfc2kxMjgoeG1tX2NyYzIsIHhtbV90MSk7CisgICAgICAgIHhtbV9jcmMzID0gX21tX3hvcl9zaTEyOCh4bW1fY3JjMywgeG1tX3QyKTsKKworICAgICAgICBpZiAobGVuID09IDApCisgICAgICAgICAgICBnb3RvIGRvbmU7CisKKyAgICAgICAgZHN0ICs9IDQ4OworICAgICAgICBzcmMgKz0gNDg7CisgICAgfSBlbHNlIGlmIChsZW4gKyAzMiA+PSAwKSB7CisgICAgICAgIGxlbiArPSAzMjsKKworICAgICAgICB4bW1fdDAgPSBfbW1fbG9hZF9zaTEyOCgoX19tMTI4aSAqKXNyYyk7CisgICAgICAgIHhtbV90MSA9IF9tbV9sb2FkX3NpMTI4KChfX20xMjhpICopc3JjICsgMSk7CisKKyAgICAgICAgZm9sZF8yKHMsICZ4bW1fY3JjMCwgJnhtbV9jcmMxLCAmeG1tX2NyYzIsICZ4bW1fY3JjMyk7CisKKyAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKWRzdCwgeG1tX3QwKTsKKyAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKWRzdCArIDEsIHhtbV90MSk7CisKKyAgICAgICAgeG1tX2NyYzIgPSBfbW1feG9yX3NpMTI4KHhtbV9jcmMyLCB4bW1fdDApOworICAgICAgICB4bW1fY3JjMyA9IF9tbV94b3Jfc2kxMjgoeG1tX2NyYzMsIHhtbV90MSk7CisKKyAgICAgICAgaWYgKGxlbiA9PSAwKQorICAgICAgICAgICAgZ290byBkb25lOworCisgICAgICAgIGRzdCArPSAzMjsKKyAgICAgICAgc3JjICs9IDMyOworICAgIH0gZWxzZSBpZiAobGVuICsgNDggPj0gMCkgeworICAgICAgICBsZW4gKz0gNDg7CisKKyAgICAgICAgeG1tX3QwID0gX21tX2xvYWRfc2kxMjgoKF9fbTEyOGkgKilzcmMpOworCisgICAgICAgIGZvbGRfMShzLCAmeG1tX2NyYzAsICZ4bW1fY3JjMSwgJnhtbV9jcmMyLCAmeG1tX2NyYzMpOworCisgICAgICAgIF9tbV9zdG9yZXVfc2kxMjgoKF9fbTEyOGkgKilkc3QsIHhtbV90MCk7CisKKyAgICAgICAgeG1tX2NyYzMgPSBfbW1feG9yX3NpMTI4KHhtbV9jcmMzLCB4bW1fdDApOworCisgICAgICAgIGlmIChsZW4gPT0gMCkKKyAgICAgICAgICAgIGdvdG8gZG9uZTsKKworICAgICAgICBkc3QgKz0gMTY7CisgICAgICAgIHNyYyArPSAxNjsKKyAgICB9IGVsc2UgeworICAgICAgICBsZW4gKz0gNjQ7CisgICAgICAgIGlmIChsZW4gPT0gMCkKKyAgICAgICAgICAgIGdvdG8gZG9uZTsKKyAgICB9CisKK3BhcnRpYWw6CisKKyNpZiBkZWZpbmVkKF9NU0NfVkVSKQorICAgIC8qIFZTIGRvZXMgbm90IHBlcm1pdCB0aGUgdXNlIG9mIF9tbV9zZXRfZXBpNjR4IGluIDMyLWJpdCBidWlsZHMgKi8KKyAgICB7CisgICAgICAgIGludDMyX3QgcGFydHNbNF0gPSB7MCwgMCwgMCwgMH07CisgICAgICAgIG1lbWNweSgmcGFydHMsIHNyYywgbGVuKTsKKyAgICAgICAgeG1tX2NyY19wYXJ0ID0gX21tX3NldF9lcGkzMihwYXJ0c1szXSwgcGFydHNbMl0sIHBhcnRzWzFdLCBwYXJ0c1swXSk7CisgICAgfQorI2Vsc2UKKyAgICB7CisgICAgICAgIGludDY0X3QgcGFydHNbMl0gPSB7MCwgMH07CisgICAgICAgIG1lbWNweSgmcGFydHMsIHNyYywgbGVuKTsKKyAgICAgICAgeG1tX2NyY19wYXJ0ID0gX21tX3NldF9lcGk2NHgocGFydHNbMV0sIHBhcnRzW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qZHN0LCBsb25nIHNpemUpOworCisjaWZkZWYgX01TQ19WRVIKKyNkZWZpbmUgSU5MSU5FIF9faW5saW5lCisjZWxzZQorI2RlZmluZSBJTkxJTkUgaW5saW5lCisjZW5kaWYKKworLyogSW5saW5lIG9wdGltaXNhdGlvbiAqLworbG9jYWwgSU5MSU5FIFBvcyBpbnNlcnRfc3RyaW5nX3NzZShkZWZsYXRlX3N0YXRlICpjb25zdCBzLCBjb25zdCBQb3Mgc3RyKTsKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgKiBMb2NhbCBkYXRhCiAgKi8KQEAgLTE2Miw3ICsxNzcsNiBAQCBsb2NhbCBjb25zdCBjb25maWcgY29uZmlndXJhdGlvbl90YWJsZVsxMF0gPSB7CiAgKi8KICNkZWZpbmUgVVBEQVRFX0hBU0gocyxoLGMpIChoID0gKCgoaCk8PHMtPmhhc2hfc2hpZnQpIF4gKGMpKSAmIHMtPmhhc2hfbWFzaykKIAotCiAvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAqIEluc2VydCBzdHJpbmcgc3RyIGluIHRoZSBkaWN0aW9uYXJ5IGFuZCBzZXQgbWF0Y2hfaGVhZCB0byB0aGUgcHJldmlvdXMgaGVhZAogICogb2YgdGhlIGhhc2ggY2hhaW4gKHRoZSBtb3N0IHJlY2VudCBzdHJpbmcgd2l0aCBzYW1lIGhhc2gga2V5KS4gUmV0dXJuCkBAIC0xNzMsMTcgKzE4NywyOCBAQCBsb2NhbCBjb25zdCBjb25maWcgY29uZmlndXJhdGlvbl90YWJsZVsxMF0gPSB7CiAgKiAgICBjaGFyYWN0ZXJzIGFuZCB0aGUgZmlyc3QgTUlOX01BVENIIGJ5dGVzIG9mIHN0ciBhcmUgdmFsaWQgKGV4Y2VwdCBmb3IKICAqICA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gbXlfdmVyc2lvblswXSB8fAogICAgICAgICBzdHJlYW1fc2l6ZSAhPSBzaXplb2Yoel9zdHJlYW0pKSB7CiAgICAgICAgIHJldHVybiBaX1ZFUlNJT05fRVJST1I7CkBAIC0zMTMsMTIgKzM0MSwxOSBAQCBpbnQgWkVYUE9SVCBkZWZsYXRlSW5pdDJfKHN0cm0sIGxldmVsLCBtZXRob2QsIHdpbmRvd0JpdHMsIG1lbUxldmVsLCBzdHJhdGVneSwKICAgICBzLT53X3NpemUgPSAxIDw8IHMtPndfYml0czsKICAgICBzLT53X21hc2sgPSBzLT53X3NpemUgLSAxOwogCi0gICAgcy0+aGFzaF9iaXRzID0gKHVJbnQpbWVtTGV2ZWwgKyA3OworICAgIGlmICh4ODZfY3B1X2VuYWJsZV9zaW1kKSB7CisgICAgICAgIHMtPmhhc2hfYml0cyA9IDE1OworICAgIH0gZWxzZSB7CisgICAgICAgIHMtPmhhc2hfYml0cyA9IG1lbUxldmVsICsgNzsKKyAgICB9CisKICAgICBzLT5oYXNoX3NpemUgPSAxIDw8IHMtPmhhc2hfYml0czsKICAgICBzLT5oYXNoX21hc2sgPSBzLT5oYXNoX3NpemUgLSAxOwogICAgIHMtPmhhc2hfc2hpZnQgPSAgKChzLT5oYXNoX2JpdHMrTUlOX01BVENILTEpL01JTl9NQVRDSCk7CiAKLSAgICBzLT53aW5kb3cgPSAoQnl0ZWYgKikgWkFMTE9DKHN0cm0sIHMtPndfc2l6ZSwgMipzaXplb2YoQnl0ZSkpOworICAgIHMtPndpbmRvdyA9IChCeXRlZiAqKSBaQUxMT0Moc3RybSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPndfc2l6ZSArIHdpbmRvd19wYWRkaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMipzaXplb2YoQnl0ZSkpOwogICAgIHMtPnByZXYgICA9IChQb3NmICopICBaQUxMT0Moc3RybSwgcy0+d19zaXplLCBzaXplb2YoUG9zKSk7Ci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ILCBzbyB0aGVyZSBhcmUKICAgICAgICAgICAgICAgICAgICAgICogYWx3YXlzIE1JTl9NQVRDSCBieXRlcyBhaGVhZC4KICAgICAgICAgICAgICAgICAgICAgICovCkBAIC0xOTUwLDcgKzE5OTUsNyBAQCBsb2NhbCBibG9ja19zdGF0ZSBkZWZsYXRlX3Nsb3cocywgZmx1c2gpCiAgICAgICAgICAqLwogICAgICAgICBoYXNoX2hlYWQgPSBOSUw7CiAgICAgICAgIGlmIChzLT5sb29rYWhlYWQgPj0gTUlOX01BVENIKSB7Ci0gICAgICAgICAgICBJTlNFUlRfU1RSSU5HKHMsIHMtPnN0cnN0YXJ0LCBoYXNoX2hlYWQpOworICAgICAgICAgICAgaGFzaF9oZWFkID0gaW5zZXJ0X3N0cmluZyhzLCBzLT5zdHJzdGFydCk7CiAgICAgICAgIH0KIAogICAgICAgICAvKiBGaW5kIHRoZSBsb25nZXN0IG1hdGNoLCBkaXNjYXJkaW5nIHRob3NlIDw9IHByZXZfbGVuZ3RoLgpAQCAtMjAwMSw3ICsyMDQ2LDcgQEAgbG9jYWwgYmxvY2tfc3RhdGUgZGVmbGF0ZV9zbG93KHMsIGZsdXNoKQogICAgICAgICAgICAgcy0+cHJldl9sZW5ndGggLT0gMjsKICAgICAgICAgICAgIGRvIHsKICAgICAgICAgICAgICAgICBpZiAoKytzLT5zdHJzdGFydCA8PSBtYXhfaW5zZXJ0KSB7Ci0gICAgICAgICAgICAgICAgICAgIElOU0VSVF9TVFJJTkcocywgcy0+c3Ryc3RhcnQsIGhhc2hfaGVhZCk7CisgICAgICAgICAgICAgICAgICAgIGhhc2hfaGVhZCA9IGluc2VydF9zdHJpbmcocywgcy0+c3Ryc3RhcnQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gd2hpbGUgKC0tcy0+cHJldl9sZW5ndGggIT0gMCk7CiAgICAgICAgICAgICBzLT5tYXRjaF9hdmFpbGFibGUgPSAwOwpAQCAtMjE2MSwzICsyMjA2LDM3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gdXNlLCBzZWUgY29weXJpZ2h0IG5vdGljZSBpbiB6bGliLmgKKyAqLworCisjaW5jbHVkZSA8aW1taW50cmluLmg+CisjaW5jbHVkZSAiZGVmbGF0ZS5oIgorCisjZGVmaW5lIFVQREFURV9IQVNIKHMsaCxpKSBcCisgICAge1wKKyAgICAgICAgaWYgKHMtPmxldmVsIDwgNikgeyBcCisgICAgICAgICAgICBoID0gKDM0ODMgKiAocy0+d2luZG93W2ldKSArXAorICAgICAgICAgICAgICAgICAyMzA4MSogKHMtPndpbmRvd1tpKzFdKSArXAorICAgICAgICAgICAgICAgICA2OTU0ICogKHMtPndpbmRvd1tpKzJdKSArXAorICAgICAgICAgICAgICAgICAyMDk0NyogKHMtPndpbmRvd1tpKzNdKSkgJiBzLT5oYXNoX21hc2s7XAorICAgICAgICB9IGVsc2Uge1wKKyAgICAgICAgICAgIGggPSAoMjU4ODEqIChzLT53aW5kb3dbaV0pICtcCisgICAgICAgICAgICAgICAgIDI0Njc0KiAocy0+d2luZG93W2krMV0pICtcCisgICAgICAgICAgICAgICAgIDI1ODExKiAocy0+d2luZG93W2krMl0pKSAmIHMtPmhhc2hfbWFzaztcCisgICAgICAgIH1cCisgICAgfVwKKworZXh0ZXJuIGludCBkZWZsYXRlX3JlYWRfYnVmIE9GKCh6X3N0cmVhbXAgc3RybSwgQnl0ZWYgKmJ1ZiwgdW5zaWduZWQgc2l6ZSkpOworCit2b2lkIGZpbGxfd2luZG93X3NzZShkZWZsYXRlX3N0YXRlICpzKQoreworICAgIGNvbnN0IF9fbTEyOGkgeG1tX3dzaXplID0gX21tX3NldDFfZXBpMTYocy0+d19zaXplKTsKKworICAgIHJlZ2lzdGVyIHVuc2lnbmVkIG47CisgICAgcmVnaXN0ZXIgUG9zZiAqcDsKKyAgICB1bnNpZ25lZCBtb3JlOyAgICAvKiBBbW91bnQgb2YgZnJlZSBzcGFjZSBhdCB0aGUgZW5kIG9mIHRoZSB3aW5kb3cuICovCisgICAgdUludCB3c2l6ZSA9IHMtPndfc2l6ZTsKKworICAgIEFzc2VydChzLT5sb29rYWhlYWQgPCBNSU5fTE9PS0FIRUFELCAiYWxyZWFkeSBlbm91Z2ggbG9va2FoZWFkIik7CisKKyAgICBkbyB7CisgICAgICAgIG1vcmUgPSAodW5zaWduZWQpKHMtPndpbmRvd19zaXplIC0odWxnKXMtPmxvb2thaGVhZCAtKHVsZylzLT5zdHJzdGFydCk7CisKKyAgICAgICAgLyogRGVhbCB3aXRoICFAIyQlIDY0SyBsaW1pdDogKi8KKyAgICAgICAgaWYgKHNpemVvZihpbnQpIDw9IDIpIHsKKyAgICAgICAgICAgIGlmIChtb3JlID09IDAgJiYgcy0+c3Ryc3RhcnQgPT0gMCAmJiBzLT5sb29rYWhlYWQgPT0gMCkgeworICAgICAgICAgICAgICAgIG1vcmUgPSB3c2l6ZTsKKworICAgICAgICAgICAgfSBlbHNlIGlmIChtb3JlID09ICh1bnNpZ25lZCkoLTEpKSB7CisgICAgICAgICAgICAgICAgLyogVmVyeSB1bmxpa2VseSwgYnV0IHBvc3NpYmxlIG9uIDE2IGJpdCBtYWNoaW5lIGlmCisgICAgICAgICAgICAgICAgICogc3Ryc3RhcnQgPT0gMCAmJiBsb29rYWhlYWQgPT0gMSAoaW5wdXQgZG9uZSBhIGJ5dGUgYXQgdGltZSkKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBtb3JlLS07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBJZiB0aGUgd2luZG93IGlzIGFsbW9zdCBmdWxsIGFuZCB0aGVyZSBpcyBpbnN1ZmZpY2llbnQgbG9va2FoZWFkLAorICAgICAgICAgKiBtb3ZlIHRoZSB1cHBlciBoYWxmIHRvIHRoZSBsb3dlciBvbmUgdG8gbWFrZSByb29tIGluIHRoZSB1cHBlciBoYWxmLgorICAgICAgICAgKi8KKyAgICAgICAgaWYgKHMtPnN0cnN0YXJ0ID49IHdzaXplK01BWF9ESVNUKHMpKSB7CisKKyAgICAgICAgICAgIHptZW1jcHkocy0+d2luZG93LCBzLT53aW5kb3crd3NpemUsICh1bnNpZ25lZCl3c2l6ZSk7CisgICAgICAgICAgICBzLT5tYXRjaF9zdGFydCAtPSB3c2l6ZTsKKyAgICAgICAgICAgIHMtPnN0cnN0YXJ0ICAgIC09IHdzaXplOyAvKiB3ZSBub3cgaGF2ZSBzdHJzdGFydCA+PSBNQVhfRElTVCAqLworICAgICAgICAgICAgcy0+YmxvY2tfc3RhcnQgLT0gKGxvbmcpIHdzaXplOworCisgICAgICAgICAgICAvKiBTbGlkZSB0aGUgaGFzaCB0YWJsZSAoY291bGQgYmUgYXZvaWRlZCB3aXRoIDMyIGJpdCB2YWx1ZXMKKyAgICAgICAgICAgICAgIGF0IHRoZSBleHBlbnNlIG9mIG1lbW9yeSB1c2FnZSkuIFdlIHNsaWRlIGV2ZW4gd2hlbiBsZXZlbCA9PSAwCisgICAgICAgICAgICAgICB0byBrZWVwIHRoZSBoYXNoIHRhYmxlIGNvbnNpc3RlbnQgaWYgd2Ugc3dpdGNoIGJhY2sgdG8gbGV2ZWwgPiAwCisgICAgICAgICAgICAgICBsYXRlci4gKFVzaW5nIGxldmVsIDAgcGVybWFuZW50bHkgaXMgbm90IGFuIG9wdGltYWwgdXNhZ2Ugb2YKKyAgICAgICAgICAgICAgIHpsaWIsIHNvIHdlIGRvbid0IGNhcmUgYWJvdXQgdGhpcyBwYXRob2xvZ2ljYWwgY2FzZS4pCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG4gPSBzLT5oYXNoX3NpemU7CisgICAgICAgICAgICBwID0gJnMtPmhlYWRbbl07CisgICAgICAgICAgICBwIC09IDg7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgX19tMTI4aSB2YWx1ZSwgcmVzdWx0OworCisgICAgICAgICAgICAgICAgdmFsdWUgPSBfbW1fbG9hZHVfc2kxMjgoKF9fbTEyOGkgKilwKTsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBfbW1fc3Vic19lcHUxNih2YWx1ZSwgeG1tX3dzaXplKTsKKyAgICAgICAgICAgICAgICBfbW1fc3RvcmV1X3NpMTI4KChfX20xMjhpICopcCwgcmVzdWx0KTsKKworICAgICAgICAgICAgICAgIHAgLT0gODsKKyAgICAgICAgICAgICAgICBuIC09IDg7CisgICAgICAgICAgICB9IHdoaWxlIChuID4gMCk7CisKKyAgICAgICAgICAgIG4gPSB3c2l6ZTsKKyNpZm5kZWYgRkFTVEVTVAorICAgICAgICAgICAgcCA9ICZzLT5wcmV2W25dOworICAgICAgICAgICAgcCAtPSA4OworICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgIF9fbTEyOGkgdmFsdWUsIHJlc3VsdDsKKworICAgICAgICAgICAgICAgIHZhbHVlID0gX21tX2xvYWR1X3NpMTI4KChfX20xMjhpICopcCk7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gX21tX3N1YnNfZXB1MTYodmFsdWUsIHhtbV93c2l6ZSk7CisgICAgICAgICAgICAgICAgX21tX3N0b3JldV9zaTEyOCgoX19tMTI4aSAqKXAsIHJlc3VsdCk7CisKKyAgICAgICAgICAgICAgICBwIC09IDg7CisgICAgICAgICAgICAgICAgbiAtPSA4OworICAgICAgICAgICAgfSB3aGlsZSAobiA+IDApOworI2VuZGlmCisgICAgICAgICAgICBtb3JlICs9IHdzaXplOworICAgICAgICB9CisgICAgICAgIGlmIChzLT5zdHJtLT5hdmFpbF9pbiA9PSAwKSBicmVhazsKKworICAgICAgICAvKiBJZiB0aGVyZSB3YXMgbm8gc2xpZGluZzoKKyAgICAgICAgICogICAgc3Ryc3RhcnQgPD0gV1NJWkUrTUFYX0RJU1QtMSAmJiBsb29rYWhlYWQgPD0gTUlOX0xPT0tBSEVBRCAtIDEgJiYKKyAgICAgICAgICogICAgbW9yZSA9PSB3aW5kb3dfc2l6ZSAtIGxvb2thaGVhZCAtIHN0cnN0YXJ0CisgICAgICAgICAqID0+IG1vcmUgPj0gd2luZG93X3NpemUgLSAoTUlOX0xPT0tBSEVBRC0xICsgV1NJWkUgKyBNQVhfRElTVC0xKQorICAgICAgICAgKiA9PiBtb3JlID49IHdpbmRvd19zaXplIC0gMipXU0laRSArIDIKKyAgICAgICAgICogSW4gdGhlIEJJR19NRU0gb3IgTU1BUCBjYXNlIChub3QgeWV0IHN1cHBvcnRlZCksCisgICAgICAgICAqICAgd2luZG93X3NpemUgPT0gaW5wdXRfc2l6ZSArIE1JTl9MT09LQUhFQUQgICYmCisgICAgICAgICAqICAgc3Ryc3RhcnQgKyBzLT5sb29rYWhlYWQgPD0gaW5wdXRfc2l6ZSA9PiBtb3JlID49IE1JTl9MT09LQUhFQUQuCisgICAgICAgICAqIE90aGVyd2lzZSwgd2luZG93X3NpemUgPT0gMipXU0laRSBzbyBtb3JlID49IDIuCisgICAgICAgICAqIElmIHRoZXJlIHdhcyBzbGlkaW5nLCBtb3JlID49IFdTSVpFLiBTbyBpbiBhbGwgY2FzZXMsIG1vcmUgPj0gMi4KKyAgICAgICAgICovCisgICAgICAgIEFzc2VydChtb3JlID49IDIsICJtb3JlIDwgMiIpOworCisgICAgICAgIG4gPSBkZWZsYXRlX3JlYWRfYnVmKHMtPnN0cm0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPndpbmRvdyArIHMtPnN0cnN0YXJ0ICsgcy0+bG9va2FoZWFkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3JlKTsKKyAgICAgICAgcy0+bG9va2FoZWFkICs9IG47CisKKyAgICAgICAgLyogSW5pdGlhbGl6ZSB0aGUgaGFzaCB2YWx1ZSBub3cgdGhhdCB3ZSBoYXZlIHNvbWUgaW5wdXQ6ICovCisgICAgICAgIGlmIChzLT5sb29rYWhlYWQgPj0gTUlOX01BVENIKSB7CisgICAgICAgICAgICB1SW50IHN0ciA9IHMtPnN0cnN0YXJ0OworICAgICAgICAgICAgcy0+aW5zX2ggPSBzLT53aW5kb3dbc3RyXTsKKyAgICAgICA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AgICAgKiByb3V0aW5lcyBhbGxvdyBzY2FubmluZyB0byBzdHJzdGFydCArIE1BWF9NQVRDSCwgaWdub3JpbmcgbG9va2FoZWFkLgorICAgICAqLworICAgIGlmIChzLT5oaWdoX3dhdGVyIDwgcy0+d2luZG93X3NpemUpIHsKKyAgICAgICAgdWxnIGN1cnIgPSBzLT5zdHJzdGFydCArICh1bGcpKHMtPmxvb2thaGVhZCk7CisgICAgICAgIHVsZyBpbml0OworCisgICAgICAgIGlmIChzLT5oaWdoX3dhdGVyIDwgY3VycikgeworICAgICAgICAgICAgLyogUHJldmlvdXMgaGlnaCB3YXRlciBtYXJrIGJlbG93IGN1cnJlbnQgZGF0YSAtLSB6ZXJvIFdJTl9JTklUCisgICAgICAgICAgICAgKiBieXRlcyBvciB1cCB0byBlbmQgb2Ygd2luZG93LCB3aGljaGV2ZXIgaXMgbGVzcy4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaW5pdCA9IHMtPndpbmRvd19zaXplIC0gY3VycjsKKyAgICAgICAgICAgIGlmIChpbml0ID4gV0lOX0lOSVQpCisgICAgICAgICAgICAgICAgaW5pdCA9IFdJTl9JTklUOworICAgICAgICAgICAgem1lbXplcm8ocy0+d2luZG93ICsgY3VyciwgKHVuc2lnbmVkKWluaXQpOworICAgICAgICAgICAgcy0+aGlnaF93YXRlciA9IGN1cnIgKyBpbml0OworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhpZ2hfd2F0ZXIgPCAodWxnKWN1cnIgKyBXSU5fSU5JVCkgeworICAgICAgICAgICAgLyogSGlnaCB3YXRlciBtYXJrIGF0IG9yIGFib3ZlIGN1cnJlbnQgZGF0YSwgYnV0IGJlbG93IGN1cnJlbnQgZGF0YQorICAgICAgICAgICAgICogcGx1cyBXSU5fSU5JVCAtLSB6ZXJvIG91dCB0byBjdXJyZW50IGRhdGEgcGx1cyBXSU5fSU5JVCwgb3IgdXAKKyAgICAgICAgICAgICAqIHRvIGVuZCBvZiB3aW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Nl9jcHVfZW5hYmxlX3NpbWQgPSAwOworCit2b2lkIFpMSUJfSU5URVJOQUwgY3JjX2ZvbGRfaW5pdChkZWZsYXRlX3N0YXRlICpjb25zdCBzKSB7CisgICAgYXNzZXJ0KDApOworfQorCit2b2lkIFpMSUJfSU5URVJOQUwgY3JjX2ZvbGRfY29weShkZWZsYXRlX3N0YXRlICpjb25zdCBzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqZHN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdW5zaWduZWQgY2hhciAqc3JjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBsZW4pIHsKKyAgICBhc3NlcnQoMCk7Cit9CisKK3Vuc2lnbmVkIFpMSUJfSU5URVJOQUwgY3JjX2ZvbGRfNTEydG8zMihkZWZsYXRlX3N0YXRlICpjb25zdCBzKSB7CisgICAgYXNzZXJ0KDApOworICAgIHJldHVybiAwOworfQorCit2b2lkIFpMSUJfSU5URVJOQUwgZmlsbF93aW5kb3dfc3NlKGRlZmxhdGVfc3RhdGUgKnMpCit7CisgICAgYXNzZXJ0KDApOworfQorCit2b2lkIHg4Nl9jaGVja19mZWF0dXJlcyh2b2lkKQoreworfQpkaWZmIC0tZ2l0IGEveDg2LmMgYi94ODYuYwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwMDAwMDAuLmU1NmZlOGI4NWEzOQotLS0gL2Rldi9udWxsCisrKyBiL3g4Ni5jCkBAIC0wLDAgKzEsOTIgQEAKKy8qCisgKiB4ODYgZmVhdHVyZSBjaGVjaworICoKKyAqIENvcHlyaWdodCAoQykgMjAxMyBJbnRlbCBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqIEF1dGhvcjoKKyAqICBKaW0gS3VrdW5hcworICogCisgKiBGb3IgY29uZGl0aW9ucyBvZiBkaXN0cmlidXRpb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j1jIiAoZWN4KSwgIj1kIiAoZWR4KQorICAgICk7CisjZW5kaWYgIC8qIChfX2kzODZfXykgKi8KKworICAgIHg4Nl9jcHVfaGFzX3NzZTIgPSBlZHggJiAweDQwMDAwMDA7CisgICAgeDg2X2NwdV9oYXNfc3NlNDIgPSBlY3ggJiAweDEwMDAwMDsKKyAgICB4ODZfY3B1X2hhc19wY2xtdWxxZHEgPSBlY3ggJiAweDI7CisKKyAgICB4ODZfY3B1X2VuYWJsZV9zaW1kID0geDg2X2NwdV9oYXNfc3NlMiAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICB4ODZfY3B1X2hhc19zc2U0MiAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICB4ODZfY3B1X2hhc19wY2xtdWxxZHE7Cit9CisjZWxzZQorI2luY2x1ZGUgPGludHJpbi5oPgorI2luY2x1ZGUgPHdpbmRvd3MuaD4KKworc3RhdGljIEJPT0wgQ0FMTEJBQ0sgX3g4Nl9jaGVja19mZWF0dXJlcyhQSU5JVF9PTkNFIG9uY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBWT0lEIHBhcmFtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVk9JRCAqY29udGV4dCk7CitzdGF0aWMgSU5JVF9PTkNFIGNwdV9jaGVja19pbml0ZWRfb25jZSA9IElOSVRfT05DRV9TVEFUSUNfSU5JVDsKKwordm9pZCB4ODZfY2hlY2tfZmVhdHVyZXModm9pZCkKK3sKKyAgICBJbml0T25jZUV4ZWN1dGVPbmNlKCZjcHVfY2hlY2tfaW5pdGVkX29uY2UsIF94ODZfY2hlY2tfZmVhdHVyZXMsCisgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBOVUxMKTsKK30KKworc3RhdGljIEJPT0wgQ0FMTEJBQ0sgX3g4Nl9jaGVja19mZWF0dXJlcyhQSU5JVF9PTkNFIG9uY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgIC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