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AgICAgICAgICAgXG5cdCIKIAkJIiAgIG1vdiAgICByMTUsICAgcjEgICAgICBcblx0IiAvKiByMSA9IHNhdmVkIHNwICovCiAJCSIgICBtb3YgICAgIy04LCAgIHIxNSAgICAgXG5cdCIgLyogTE9HSU4gKi8KLQkJIiAgIG1vdi5sICBAJTEsICAgJTAgICAgICBcblx0IiAvKiBsb2FkICBvbGQgdmFsdWUgKi8KLQkJIiAgIGNtcC9lcSAgJTAsICAgJTIgICAgICBcblx0IgorCQkiICAgbW92LmwgIEAlMywgICAlMCAgICAgIFxuXHQiIC8qIGxvYWQgIG9sZCB2YWx1ZSAqLworCQkiICAgY21wL2VxICAlMCwgICAlMSAgICAgIFxuXHQiCiAJCSIgICBiZiAgICAgICAgICAgIDFmICAgICAgXG5cdCIgLyogaWYgbm90IGVxdWFsICovCi0JCSIgICBtb3YubCAgICUzLCAgIEAlMSAgICAgXG5cdCIgLyogc3RvcmUgbmV3IHZhbHVlICovCisJCSIgICBtb3YubCAgICUyLCAgIEAlMyAgICAgXG5cdCIgLyogc3RvcmUgbmV3IHZhbHVlICovCiAJCSIxOiBtb3YgICAgIHIxLCAgIHIxNSAgICAgXG5cdCIgLyogTE9HT1VUICovCi0JCTogIj0mciIgKHJldHZhbCkKLQkJOiAgInIiICAobSksICJyIiAgKG9sZCksICJyIiAgKG5ldykKKwkJOiAiPSZyIiAocmV0dmFsKSwKKwkJICAiK3IiICAob2xkKSwgIityIiAgKG5ldykgLyogb2xkIG9yIG5ldyBjYW4gYmUgcjE1ICovCisJCTogICJyIiAgKG0pCiAJCTogIm1lbW9yeSIgLCAicjAiLCAicjEiLCAidCIpOwogCiAJcmV0dXJuIHJldHZhbDsKZGlmZiAtLWdpdCBhL2FyY2gvc2gvaW5jbHVkZS9hc20vbW16b25lLmggYi9hcmNoL3NoL2luY2x1ZGUvYXNtL21tem9uZS5oCmluZGV4IDg4ODdiYWYuLjE1YTg0OTYgMTAwNjQ0Ci0tLSBhL2FyY2gvc2gvaW5jb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BDSElQX0NFREFSOgorCQlkZWZhdWx0OgorCQkJbnVtX3BzX2dwcnMgPSA5MzsKKwkJCW51bV92c19ncHJzID0gNDY7CisJCQludW1fdGVtcF9ncHJzID0gNDsKKwkJCW51bV9nc19ncHJzID0gMzE7CisJCQludW1fZXNfZ3BycyA9IDMxOworCQkJbnVtX2hzX2dwcnMgPSAyMzsKKwkJCW51bV9sc19ncHJzID0gMjM7CisJCQludW1fcHNfdGhyZWFkcyA9IDk2OworCQkJbnVtX3ZzX3RocmVhZHMgPSAxNjsKKwkJCW51bV9nc190aHJlYWRzID0gMTY7CisJCQludW1fZXNfdGhyZWFkcyA9IDE2OworCQkJbnVtX2hzX3RocmVhZHMgPSAxNjsKKwkJCW51bV9sc190aHJlYWRzID0gMTY7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX3ZzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9nc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fZXNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2hzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9sc19zdGFja19lbnRyaWVzID0gNDI7CisJCQlicmVhazsKKwkJY2FzZSBDSElQX1JFRFdPT0Q6CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gMTI4OworCQkJbnVtX3ZzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9nc190aHJlYWRzID0gMjA7CisJCQludW1fZXNfdGhyZWFkcyA9IDIwOworCQkJbnVtX2hzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9sc190aHJlYWRzID0gMjA7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX3ZzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9nc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fZXNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2hzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9sc19zdGFja19lbnRyaWVzID0gNDI7CisJCQlicmVhazsKKwkJY2FzZSBDSElQX0pVTklQRVI6CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gMTI4OworCQkJbnVtX3ZzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9nc190aHJlYWRzID0gMjA7CisJCQludW1fZXNfdGhyZWFkcyA9IDIwOworCQkJbnVtX2hzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9sc190aHJlYWRzID0gMjA7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX3ZzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9nc19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1fZXNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX2hzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9sc19zdGFja19lbnRyaWVzID0gODU7CisJCQlicmVhazsKKwkJY2FzZSBDSElQX0NZUFJFU1M6CisJCWNhc2UgQ0hJUF9IRU1MT0NLOgorCQkJbnVtX3BzX2dwcnMgPSA5MzsKKwkJCW51bV92c19ncHJzID0gNDY7CisJCQludW1fdGVtcF9ncHJzID0gNDsKKwkJCW51bV9nc19ncHJzID0gMzE7CisJCQludW1fZXNfZ3BycyA9IDMxOworCQkJbnVtX2hzX2dwcnMgPSAyMzsKKwkJCW51bV9sc19ncHJzID0gMjM7CisJCQludW1fcHNfdGhyZWFkcyA9IDEyODsKKwkJCW51bV92c190aHJlYWRzID0gMjA7CisJCQludW1fZ3NfdGhyZWFkcyA9IDIwOworCQkJbnVtX2VzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9oc190aHJlYWRzID0gMjA7CisJCQludW1fbHNfdGhyZWFkcyA9IDIwOworCQkJbnVtX3BzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV92c19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1fZ3Nfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX2VzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9oc19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1fbHNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJYnJlYWs7CisJCWNhc2UgQ0hJUF9QQUxNOgorCQkJbnVtX3BzX2dwcnMgPSA5MzsKKwkJCW51bV92c19ncHJzID0gNDY7CisJCQludW1fdGVtcF9ncHJzID0gNDsKKwkJCW51bV9nc19ncHJzID0gMzE7CisJCQludW1fZXNfZ3BycyA9IDMxOworCQkJbnVtX2hzX2dwcnMgPSAyMzsKKwkJCW51bV9sc19ncHJzID0gMjM7CisJCQludW1fcHNfdGhyZWFkcyA9IDk2OworCQkJbnVtX3ZzX3RocmVhZHMgPSAxNjsKKwkJCW51bV9nc190aHJlYWRzID0gMTY7CisJCQludW1fZXNfdGhyZWFkcyA9IDE2OworCQkJbnVtX2hzX3RocmVhZHMgPSAxNjsKKwkJCW51bV9sc190aHJlYWRzID0gMTY7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX3ZzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9nc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fZXNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2hzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9sc19zdGFja19lbnRyaWVzID0gNDI7CisJCQlicmVhazsKKwkJY2FzZSBDSElQX1NVTU86CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gOTY7CisJCQludW1fdnNfdGhyZWFkcyA9IDI1OworCQkJbnVtX2dzX3RocmVhZHMgPSAyNTsKKwkJCW51bV9lc190aHJlYWRzID0gMjU7CisJCQludW1faHNfdGhyZWFkcyA9IDI1OworCQkJbnVtX2xzX3RocmVhZHMgPSAyNTsKKwkJCW51bV9wc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fdnNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2dzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9lc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1faHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2xzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCWJyZWFrOworCQljYXNlIENISVBfU1VNTzI6CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gOTY7CisJCQludW1fdnNfdGhyZWFkcyA9IDI1OworCQkJbnVtX2dzX3RocmVhZHMgPSAyNTsKKwkJCW51bV9lc190aHJlYWRzID0gMjU7CisJCQludW1faHNfdGhyZWFkcyA9IDI1OworCQkJbnVtX2xzX3RocmVhZHMgPSAyNTsKKwkJCW51bV9wc19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1fdnNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX2dzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9lc19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1faHNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX2xzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCWJyZWFrOworCQljYXNlIENISVBfQkFSVFM6CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gMTI4OworCQkJbnVtX3ZzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9nc190aHJlYWRzID0gMjA7CisJCQludW1fZXNfdGhyZWFkcyA9IDIwOworCQkJbnVtX2hzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9sc190aHJlYWRzID0gMjA7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX3ZzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9nc19zdGFja19lbnRyaWVzID0gODU7CisJCQludW1fZXNfc3RhY2tfZW50cmllcyA9IDg1OworCQkJbnVtX2hzX3N0YWNrX2VudHJpZXMgPSA4NTsKKwkJCW51bV9sc19zdGFja19lbnRyaWVzID0gODU7CisJCQlicmVhazsKKwkJY2FzZSBDSElQX1RVUktTOgorCQkJbnVtX3BzX2dwcnMgPSA5MzsKKwkJCW51bV92c19ncHJzID0gNDY7CisJCQludW1fdGVtcF9ncHJzID0gNDsKKwkJCW51bV9nc19ncHJzID0gMzE7CisJCQludW1fZXNfZ3BycyA9IDMxOworCQkJbnVtX2hzX2dwcnMgPSAyMzsKKwkJCW51bV9sc19ncHJzID0gMjM7CisJCQludW1fcHNfdGhyZWFkcyA9IDEyODsKKwkJCW51bV92c190aHJlYWRzID0gMjA7CisJCQludW1fZ3NfdGhyZWFkcyA9IDIwOworCQkJbnVtX2VzX3RocmVhZHMgPSAyMDsKKwkJCW51bV9oc190aHJlYWRzID0gMjA7CisJCQludW1fbHNfdGhyZWFkcyA9IDIwOworCQkJbnVtX3BzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV92c19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fZ3Nfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX2VzX3N0YWNrX2VudHJpZXMgPSA0MjsKKwkJCW51bV9oc19zdGFja19lbnRyaWVzID0gNDI7CisJCQludW1fbHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJYnJlYWs7CisJCWNhc2UgQ0hJUF9DQUlDT1M6CisJCQludW1fcHNfZ3BycyA9IDkzOworCQkJbnVtX3ZzX2dwcnMgPSA0NjsKKwkJCW51bV90ZW1wX2dwcnMgPSA0OworCQkJbnVtX2dzX2dwcnMgPSAzMTsKKwkJCW51bV9lc19ncHJzID0gMzE7CisJCQludW1faHNfZ3BycyA9IDIzOworCQkJbnVtX2xzX2dwcnMgPSAyMzsKKwkJCW51bV9wc190aHJlYWRzID0gMTI4OworCQkJbnVtX3ZzX3RocmVhZHMgPSAxMDsKKwkJCW51bV9nc190aHJlYWRzID0gMTA7CisJCQludW1fZXNfdGhyZWFkcyA9IDEwOworCQkJbnVtX2hzX3RocmVhZHMgPSAxMDsKKwkJCW51bV9sc190aHJlYWRzID0gMTA7CisJCQludW1fcHNfc3RhY2tfZW50cmllcyA9IDQyOworCQkJbnVtX3ZzX3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h4KSA8PCAxNikKLSNkZWZpbmUJCUFTSUNfVF9NQVNLCQkJICAgICAgICAweDdGRjAwMDAKKyNkZWZpbmUJCUFTSUNfVF9NQVNLCQkJICAgICAgICAweDA3RkYwMDAwCiAjZGVmaW5lCQlBU0lDX1RfU0hJRlQJCQkgICAgICAgIDE2CisjZGVmaW5lCUNHX1RTMF9TVEFUVVMJCQkJCTB4NzYwCisjZGVmaW5lCQlUUzBfQURDX0RPVVRfTUFTSwkJCTB4MDAwMDAzRkYKKyNkZWZpbmUJCVRTMF9BRENfRE9VVF9TSElGVAkJCTAKIC8qIEFQVSAqLwogI2RlZmluZQlDR19USEVSTUFMX1NUQVRVUwkJCSAgICAgICAgMHg2NzgKIApAQCAtNDYwLDcgKzQ2Niw3IEBACiAjZGVmaW5lIElIX1JCX1dQVFJfQUREUl9MTyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzZTE0CiAjZGVmaW5lIElIX0NOVEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzZTE4CiAjICAgICAgIGRlZmluZSBFTkFCTEVfSU5UUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgMCkKLSMgICAgICAgZGVmaW5lIElIX01DX1NXQVAoeCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHgpIDw8IDIpCisjICAgICAgIGRlZmluZSBJSF9NQ19TV0FQKHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh4KSA8PCAxKQogIyAgICAgICBkZWZpbmUgSUhfTUNfU1dBUF9OT05FICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKICMgICAgICAgZGVmaW5lIElIX01DX1NXQVBfMTZCSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAxCiAjICAgICAgIGRlZmluZSBJSF9NQ19TV0FQXzMyQklUICAgICAgICAgICAgICAgICAgICAgICAgICAgMgpAQCAtNTQxLDcgKzU0Nyw3IEBACiAjICAgICAgIGRlZmluZSBMQl9ENV9WQkxBTktfSU5URVJSVVBUICAgICAgICAgICAgICAgICAgICgxIDw8IDMpCiAjICAgICAgIGRlZmluZSBEQ19IUEQ1X0lOVEVSUlVQVCAgICAgICAgICAgICAgICAgICAgICAgICgxIDw8IDE3KQogIyAgICAgICBkZWZpbmUgRENfSFBENV9SWF9JTlRFUlJVUFQgICAgICAgICAgICAgICAgICAgICAoMSA8PCAxOCkKLSNkZWZpbmUgRElTUF9JTlRFUlJVUFRfU1RBVFVTX0NPTlRJTlVFNSAgICAgICAgICAgICAgICAgMHg2MDUwCisjZGVmaW5lIERJU1BfSU5URVJSVVBUX1NUQVRVU19DT05USU5VRTUgICAgICAgICAgICAgICAgIDB4NjE1MAogIyAgICAgICBkZWZpbmUgTEJfRDZfVkxJTkVfSU5URVJSVVBUICAgICAgICAgICAgICAgICAgICAoMSA8PCAyKQogIyAgICAgICBkZWZpbmUgTEJfRDZfVkJMQU5LX0lOVEVSUlVQVCAgICAgICAgICAgICAgICAgICAoMSA8PCAzKQogIyAgICAgICBkZWZpbmUgRENfSFBENl9JTlRFUlJVUFQgICAgICAgICAgICAgICAgICAgICAgICAoMSA8PCAxNykKZGlmZiAtLWdpdCBhL2RyaXZlcnMvZ3B1L2RybS9yYWRlb24vbmkuYyBiL2RyaXZlcnMvZ3B1L2RybS9yYWRlb24vbmkuYwppbmRleCBiMjA1YmExLi41NTlkYmQ0IDEwMDY0NAotLS0gYS9kcml2ZXJzL2dwdS9kcm0vcmFkZW9uL25pLmMKKysrIGIvZHJpdmVycy9ncHUvZHJtL3JhZGVvbi9uaS5jCkBAIC0xMzg3LDE0ICsxMzg3LDEyIEBACiAJCXJldHVybiByOwogCWNheW1hbl9ncHVfaW5pdChyZGV2KTsKIAotI2lmIDAKLQlyID0gY2F5bWFuX2JsaXRfaW5pdChyZGV2KTsKKwlyID0gZXZlcmdyZWVuX2JsaXRfaW5pdChyZGV2KTsKIAlpZiAocikgewotCQljYXltYW5fYmxpdF9maW5pKH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1cmUoZm9ybWF0LCBwLT5mYW1pbHkpKSB7CiAJCWRldl93YXJuKHAtPmRldiwgIiVzOiVkIHRleHR1cmUgaW52YWxpZCBmb3JtYXQgJWRcbiIsCiAJCQkgX19mdW5jX18sIF9fTElORV9fLCBmb3JtYXQpOwogCQlyZXR1cm4gLUVJTlZBTDsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvZ3B1L2RybS9yYWRlb24vcjYwMGQuaCBiL2RyaXZlcnMvZ3B1L2RybS9yYWRlb24vcjYwMGQuaAppbmRleCBiMmI5NDRiYy4uMDI0NWFlNiAxMDA2NDQKLS0tIGEvZHJpdmVycy9ncHUvZHJtL3JhZGVvbi9yNjAwZC5oCisrKyBiL2RyaXZlcnMvZ3B1L2RybS9yYWRlb24vcjYwMGQuaApAQCAtNTM2LDcgKzUzNiw3IEBACiAjZGVmaW5lIElIX1JCX1dQVFJfQUREUl9MTyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzZTE0CiAjZGVmaW5lIElIX0NOVEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzZTE4CiAjICAgICAgIGRlZmluZSBFTkFCTEVfSU5UUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgPDwgMCkKLSMgICAgICAgZGVmaW5lIElIX01DX1NXQVAoeCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHgpIDw8IDIpCisjICAgICAgIGRlZmluZSBJSF9NQ19TV0FQKHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh4KSA8PCAxKQogIyAgICAgICBkZWZpbmUgSUhfTUNfU1dBUF9OT05FICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAKICMgICAgICAgZGVmaW5lIElIX01DX1NXQVBfMTZCSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAxCiAjICAgICAgIGRlZmluZSBJSF9NQ19TV0FQXzMyQklUICAgICAgICAgICAgICAgICAgICAgICAgICAgMgpAQC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LworCWlmIChjb2FsZXNjZV9udW1iZXIgPiBJTlRFUlJVUFRfQ09BTEVTQ0VfTlVNQkVSX01BWCkKKwkJcmV0dXJuIFNDSV9GQUlMVVJFX0lOVkFMSURfUEFSQU1FVEVSX1ZBTFVFOworCisJLyoKKwkgKiAgRGVmaW5lZCBlbmNvZGluZyBmb3IgaW50ZXJydXB0IGNvYWxlc2NpbmcgdGltZW91dDoKKwkgKiAgICAgICAgICAgICAgVmFsdWUgICBNaW4gICAgICBNYXggICAgIFVuaXRzCisJICogICAgICAgICAgICAgIC0tLS0tICAgLS0tICAgICAgLS0tICAgICAtLS0tLQorCSAqICAgICAgICAgICAgICAwICAgICAgIC0gICAgICAgIC0gICAgICAgRGlzYWJsZWQKKwkgKiAgICAgICAgICAgICAgMSAgICAgICAxMy4zICAgICAyMC4wICAgIG5zCisJICogICAgICAgICAgICAgIDIgICAgICAgMjYuNyAgICAgNDAuMAorCSAqICAgICAgICAgICAgICAzICAgICAgIDUzLjMgICAgIDgwLjAKKwkgKiAgICAgICAgICAgICAgNCAgICAgICAxMDYuNyAgICAxNjAuMAorCSAqICAgICAgICAgICAgICA1ICAgICAgIDIxMy4zICAgIDMyMC4wCisJICogICAgICAgICAgICAgIDYgICAgICAgNDI2LjcgICAgNjQwLjAKKwkgKiAgICAgICAgICAgICAgNyAgICAgICA4NTMuMyAgICAxMjgwLjAKKwkgKiAgICAgICAgICAgICAgOCAgICAgICAxLjcgICAgICAyLjYgICAgIHVzCisJICogICAgICAgICAgICAgIDkgICAgICAgMy40ICAgICAgNS4xCisJICogICAgICAgICAgICAgIDEwICAgICAgNi44ICAgICAgMTAuMgorCSAqICAgICAgICAgICAgICAxMSAgICAgIDEzLjcgICAgIDIwLjUKKwkgKiAgICAgICAgICAgICAgMTIgICAgICAyNy4zICAgICA0MS4wCisJICogICAgICAgICAgICAgIDEzICAgICAgNTQuNiAgICAgODEuOQorCSAqICAgICAgICAgICAgICAxNCAgICAgIDEwOS4yICAgIDE2My44CisJICogICAgICAgICAgICAgIDE1ICAgICAgMjE4LjUgICAgMzI3LjcKKwkgKiAgICAgICAgICAgICAgMTYgICAgICA0MzYuOSAgICA2NTUuNAorCSAqICAgICAgICAgICAgICAxNyAgICAgIDg3My44ICAgIDEzMTAuNworCSAqICAgICAgICAgICAgICAxOCAgICAgIDEuNyAgICAgIDIuNiAgICAgbXMKKwkgKiAgICAgICAgICAgICAgMTkgICAgICAzLjUgICAgICA1LjIKKwkgKiAgICAgICAgICAgICAgMjAgICAgICA3LjAgICAgICAxMC41CisJICogICAgICAgICAgICAgIDIxICAgICAgMTQuMCAgICAgMjEuMAorCSAqICAgICAgICAgICAgICAyMiAgICAgIDI4LjAgICAgIDQxLjkKKwkgKiAgICAgICAgICAgICAgMjMgICAgICA1NS45ICAgICA4My45CisJICogICAgICAgICAgICAgIDI0ICAgICAgMTExLjggICAgMTY3LjgKKwkgKiAgICAgICAgICAgICAgMjUgICAgICAyMjMuNyAgICAzMzUuNQorCSAqICAgICAgICAgICAgICAyNiAgICAgIDQ0Ny40ICAgIDY3MS4xCisJICogICAgICAgICAgICAgIDI3ICAgICAgODk0LjggICAgMTM0Mi4yCisJICogICAgICAgICAgICAgIDI4ICAgICAgMS44ICAgICAgMi43ICAgICBzCisJICogICAgICAgICAgICAgIE90aGVycyBVbmRlZmluZWQgKi8KKworCS8qCisJICogVXNlIHRoZSB0YWJsZSBhYm92ZSB0byBkZWNpZGUgdGhlIGVuY29kZSBvZiBpbnRlcnJ1cHQgY29hbGVzY2luZyB0aW1lb3V0CisJICogdmFsdWUgZm9yIHJlZ2lzdGVyIHdyaXRpbmcuICovCisJaWYgKGNvYWxlc2NlX3RpbWVvdXQgPT0gMCkKKwkJdGltZW91dF9lbmNvZGUgPSAwOworCWVsc2V7CisJCS8qIG1ha2UgdGhlIHRpbWVvdXQgdmFsdWUgaW4gdW5pdCBvZiAoMTAgbnMpLiAqLworCQljb2FsZXNjZV90aW1lb3V0ID0gY29hbGVzY2VfdGltZW91dCAqI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ZWN1dGVfdGFzaywKKwkvKiBUYXNrIE1hbmFnZW1lbnQgRnVuY3Rpb25zLiBNdXN0IGJlIGNhbGxlZCBmcm9tIHByb2Nlc3MgY29udGV4dC4gKi8KKwkubGxkZF9hYm9ydF90YXNrCT0gaXNjaV90YXNrX2Fib3J0X3Rhc2ssCisJLmxsZGRfYWJvcnRfdGFza19zZXQJPSBpc2NpX3Rhc2tfYWJvcnRfdGFza19zZXQsCisJLmxsZGRfY2xlYXJfYWNhCQk9IGlzY2lfdGFza19jbGVhcl9hY2EsCisJLmxsZGRfY2xlYXJfdGFza19zZXQJPSBpc2NpX3Rhc2tfY2xlYXJfdGFza19zZXQsCisJLmxsZGRfSV9UX25leHVzX3Jlc2V0CT0gaXNjaV90YXNrX0lfVF9uZXh1c19yZXNldCwKKwkubGxkZF9sdV9yZXNldAkJPSBpc2NpX3Rhc2tfbHVfcmVzZXQsCisJLmxsZGRfcXVlcnlfdGFzawk9IGlzY2lfdGFza19xdWVyeV90YXNrLAorCisJLyogUG9ydCBhbmQgQWRhcHRlciBtYW5hZ2VtZW50ICovCisJLmxsZGRfY2xlYXJfbmV4dXNfcG9ydAk9IGlzY2lfdGFza19jbGVhcl9uZXh1c19wb3J0LAorCS5sbGRkX2NsZWFyX25leHVzX2hhCT0gaXNjaV90YXNrX2NsZWFyX25leHVzX2hhLAorCisJLyogUGh5IG1hbmFnZW1lbnQgKi8KKwkubGxkZF9jb250cm9sX3BoeQk9IGlzY2lfcGh5X2NvbnRyb2wsCit9OworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyogUCBSIE8gVCBFIEMgVCBFIEQgIE0gRSBUIEggTyBEIFMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisKKy8qKgorICogaXNjaV9yZWdpc3Rlc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2dldF9zYXNfYWRkcmVzcygmaWhvc3QtPnBoeXNbM10sICZzZWNvbmRfYWRkcmVzcyk7CisKKwkJaWYgKHNjaV9zYXNfYWRkcmVzc19jb21wYXJlKGZpcnN0X2FkZHJlc3MsIHNlY29uZF9hZGRyZXNzKSA9PSAwKSB7CisJCQlyZXR1cm4gU0NJX0ZBSUxVUkVfVU5TVVBQT1JURURfUE9SVF9DT05GSUdVUkFUSU9OOworCQl9CisJfQorCisJcmV0dXJuIFNDSV9TVUNDRVNTOworfQorCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBNYW51YWwgcG9ydCBjb25maWd1cmF0aW9uIGFnZW50IHJvdXRpbmVzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworLyogdmVyaWZ5IGFsbCBvZiB0aGUgcGh5cyBpbiB0aGUgc2FtZSBwb3J0IGFyZSB1c2luZyB0aGUgc2FtZSBTQVMgYWRkcmVzcyAqLworc3RhdGljIGVudW0gc2NpX3N0YXR1cworc2NpX21wY19hZ2VudF92YWxpZGF0ZV9waHlfY29uZmlndXJhdGlvbihzdHJ1Y3QgaXNjaV9ob3N0ICppaG9zdCwKKwkJCQkJICAgICAgc3RydWN0IHNjaV9wb3J0X2NvbmZpZ3VyYXRpb25fYWdlbnQgKnBvcnRfYWdlbnQpCit7CisJdTMyIHBoeV9tYXNrOworCXUzMiBhc3NpZ25lZF9waHlfbWFzazsKKwlzdHJ1Y3Qgc2NpX3Nhc19hZGRyZXNzIHNhc19hZGRyZXNzOworCXN0cnVjdCBzY2lfc2FzX2FkZHJlc3MgcGh5X2Fzc2lnbmVkX2FkZHJlc3M7CisJdTggcG9ydF9pbmRleDsKKwl1OCBwaHlfaW5kZXg7CisKKwlhc3NpZ25lZF9waHlfbWFzay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9waHlfbWFzazsKKworCXBvcnRfYWdlbnQgPSBjb250YWluZXJfb2YodG1yLCB0eXBlb2YoKnBvcnRfYWdlbnQpLCB0aW1lcik7CisJaWhvc3QgPSBjb250YWluZXJfb2YocG9ydF9hZ2VudCwgdHlwZW9mKCppaG9zdCksIHBvcnRfYWdlbnQpOworCisJc3Bpbl9sb2NrX2lycXNhdmUoJmlob3N0LT5zY2ljX2xvY2ssIGZsYWdzKTsKKworCWlmICh0bXItPmNhbmNlbCkKKwkJZ290byBkb25lOworCisJcG9ydF9hZ2VudC0+dGltZXJfcGVuZGluZyA9IGZhbHNlOworCisJY29uZmlndXJlX3BoeV9tYXNrID0gfnBvcnRfYWdlbnQtPnBoeV9jb25maWd1cmVkX21hc2sgJiBwb3J0X2FnZW50LT5waHlfcmVhZHlfbWFzazsKKworCWlmICghY29uZmlndXJlX3BoeV9tYXNrKQorCQlyZXR1cm47CisKKwlmb3IgKGluZGV4ID0gMDsgaW5kZXggPCBTQ0lfTUFYX1BIWVM7IGluZGV4KyspIHsKKwkJaWYgKChjb25maWd1cmVfcGh5X21hc2sgJiAoMSA8PCBpbmRleCkpID09IDApCisJCQljb250aW51ZTsKKworCQlzY2lfYXBjX2FnZW50X2NvbmZpZ3VyZV9wb3J0cyhpaG9zdCwgcG9ydF9hZ2VudCwKKwkJCQkJCSAgICZpaG9zdC0+cGh5c1tpbmRleF0sIGZhbHNlKTsKKwl9CisKK2RvbmU6CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmaWhvc3QtPnNjaWNfbG9jaywgZmxhZ3MpOworfQorCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBQdWJsaWMgcG9ydCBjb25maWd1cmF0aW9uIGFnZW50IHJvdXRpbmVzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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MRVNDSU5HX0NPTlRST0xfICMjIG5hbWUsIHZhbHVlKQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTTVVfVEFTS19DT05URVhUX1JBTkdFX1NUQVJUX1NISUZUICAgICAgKDApCisjZGVmaW5lIFNNVV9UQVNLX0NPTlRFWFRfUkFOR0VfU1RBUlRfTUFTSyAgICAgICAoMHgwMDAwMEZGRikKKyNkZWZpbmUgU01VX1RBU0tfQ09OVEVYVF9SQU5HRV9FTkRJTkdfU0hJRlQgICAgICgxNikKKyNkZWZpbmUgU01VX1RBU0tfQ09OVEVYVF9SQU5HRV9FTkRJTkdfTUFTSyAgICAgICgweDBGRkYwMDAwKQorI2RlZmluZSBTTVVfVEFTS19DT05URVhUX1JBTkdFX0VOQUJMRV9TSElGVCAgICAgKDMxKQorI2RlZmluZSBTTVVfVEFTS19DT05URVhUX1JBTkdFX0VOQUJMRV9NQVNLICAgICAgKDB4ODAwMDAwMDApCisjZGVmaW5lIFNNVV9UQVNLX0NPTlRFWFRfUkFOR0VfUkVTRVJWRURfTUFTSyAgICAoMHg3MDAwRjAwMCkKKworI2RlZmluZSBTTVVfVENSX0dFTl9WQUwobmFtZSwgdmFsdWUpIFwKKwlTQ1VfR0VOX1ZBTFVFKFNNVV9UQVNLX0NPTlRFWFRfUkFOR0VfICMjIG5hbWUsIHZhbHVlKQorCisjZGVmaW5lIFNNVV9UQ1JfR0VOX0JJVChuYW1lLCB2YWx1ZSkgXAorCVNDVV9HRU5fQklUKFNNVV9UQVNLX0NPTlRFWFRfUkFOR0VfICMjIG5hbWUpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKyNkZWZpbmUgU01VX0NPTVBMRVRJT05fUVVFVUVfUFVUX1BPSU5URVJfU0hJRlQgICAgICAgICAgKDApCisjZGVmaW5lIFNNVV9DT01QTEVUSU9OX1FVRVVFX1BVVF9QT0lOVEVSX01BU0sgICAgICAgICAgICgweDAwMDAzRkZGKQorI2RlZmluZSBTTVVfQ09NUExFVElPTl9RVUVVRV9QVVRfQ1lDTEVfQklUX1NISUZUICAgICAgICAoMTUpCisjZGVmaW5lIFNNVV9DT01QTEVUSU9OX1FVRVVFX1BVVF9DWUNMRV9CSVRfTUFTSyAgICAgICAgICgweDAwMDA4MDAwKQorI2RlZmluZSBTTVVfQ09NUExFVElPTl9RVUVVRV9QVVRfRVZFTlRfUE9JTlRFUl9TSElGVCAgICAoMTYpCisjZGVmaW5lIFNNVV9DT01QTEVUSU9OX1FVRVVFX1BVVF9FVkVOVF9QT0lOVEVSX01BU0sgICAgICgweDAzRkYwMDAwKQorI2RlZmluZSBTTVVfQ09NUExFVElPTl9RVUVVRV9QVVRfRVZFTlRfQ1lDTEVfQklUX1NISUZUICAoMjYpCisjZGVmaW5lIFNNVV9DT01QTEVUSU9OX1FVRVVFX1BVVF9FVkVOVF9DWUNMRV9CSVRfTUFTSyAgICgweDA0MDAwMDAwKQorI2RlZmluZSBTTVVfQ09NUExFVElPTl9RVUVVRV9QVVRfUkVTRVJWRURfTUFTSyAgICAgICAgICAoMHhGODAwNDAwMCkKKworI2RlZmluZSBTTVVfQ1FQUl9HRU5fVkFMKG5hbWUsIHZhbHVlKSBcCisJU0NVX0dFTl9WQUxVRShTTVVfQ09NUExFVElPTl9RVUVVRV9QVVRfICMjIG5hbWUsIHZhbHVlKQorCisjZGVmaW5lIFNNVV9DUVBSX0dFTl9CSVQobmFtZSkgXAorCVNDVV9HRU5fQklUKFNNVV9DT01QTEVUSU9OX1FVRVVFX1BVVF8gIyMgbmFtZSkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworI2RlZmluZSBTTVVfQ09NUExF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FVUUocGVnLCAxKSBcCisJCXwgU01VX1JFU0VUX1BFR19QUk9UT0NPTF9FTkdJTkVTKHBlZykgXAorCSkKKworI2RlZmluZSBTTVVfUkVTRVRfQUxMX1BST1RPQ09MX0VOR0lORV9HUk9VUFMoKSBcCisJKFwKKwkJU01VX1JFU0VUX1BST1RPQ09MX0VOR0lORV9HUk9VUCgwKSBcCisJCXwgU01VX1JFU0VUX1BST1RPQ09MX0VOR0lORV9HUk9VUCgxKSBcCisJKQorCisjZGVmaW5lIFNNVV9SRVNFVF9TQ1UoKSAgKDB4RkZGRkZGRkYpCisKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTTVVfVEFTS19DT05URVhUX0FTU0lHTk1FTlRfU1RBUlRJTkdfU0hJRlQgICAgICAgICAgICAgICgwKQorI2RlZmluZSBTTVVfVEFTS19DT05URVhUX0FTU0lHTk1FTlRfU1RBUlRJTkdfTUFTSyAgICAgICAgICAgICAgICgweDAwMDAwRkZGKQorI2RlZmluZSBTTVVfVEFTS19DT05URVhUX0FTU0lHTk1FTlRfRU5ESU5HX1NISUZUICAgICAgICAgICAgICAgICgxNikKKyNkZWZpbmUgU01VX1RBU0tfQ09OVEVYVF9BU1NJR05NRU5UX0VORElOR19NQVNLICAgICAgICAgICAgICAgICAoMHgwRkZGMDAwMCkKKyNkZWZpbmUgU01VX1RBU0tfQ09OVEVYVF9BU1NJR05NRU5UX1JBTkdFX0NIRUNLX0VOQUJMRV9TSElGVCAgICAoMzEpCisjZGVmaW5lIFNNVV9UQVNLX0NPTlRFWFRfQVNTSUdOTUVOVF9SQU5HRV9DSEVDS19FTkFCTEVfTUFTSyAgICAgKDB4ODAwMDAwMDApCisjZGVmaW5lIFNNVV9UQVNLX0NPTlRFWFRfQVNTSUdOTUVOVF9SRVNFUlZFRF9NQVNLICAgICAgICAgICAgICAgKDB4NzAwM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KKworI2RlZmluZSBTQ1VfVUZRR1BfRU5BQkxFKHZhbHVlKQlcCisJKFNDVV9VRlFHUF9HRU5fQklUKEVOQUJMRSkgfCB2YWx1ZSkKKworI2RlZmluZSBTQ1VfVUZRR1BfRElTQUJMRSh2YWx1ZSkgXAorCSh+U0NVX1VGUUdQX0dFTl9CSVQoRU5BQkxFKSAmIHZhbHVlKQorCisjZGVmaW5lIFNDVV9VRlFHUF9WQUxVRShiaXQsIHZhbHVlKSBcCisJKFNDVV9VRlFHUF9DWUNMRV9CSVQoYml0KSB8IFNDVV9VRlFHUF9HRVRfUE9JTlRFUih2YWx1ZSkpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fQUREUkVTU19NT0RJRklFUl9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgU0NVX1BETUFfQ09ORklHVVJBVElPTl9BRERSRVNTX01PRElGSUVSX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgweDAwMDBGRkZGKQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX1BDSV9SRUxBWEVEX09SREVSSU5HX0VOQUJMRV9TSElGVCAgICAgICAgICAgICAgICAgICAgKDE2KQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX1BDSV9SRUxBWEVEX09SREVSSU5HX0VOQUJMRV9NQVNLICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMTAwMDApCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fUENJX05PX1NOT09QX0VOQUJMRV9TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMTcpCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fUENJX05PX1NOT09QX0VOQUJMRV9NQVNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHgwMDAyMDAwMCkKKyNkZWZpbmUgU0NVX1BETUFfQ09ORklHVVJBVElPTl9CSUdfRU5ESUFOX0NPTlRST0xfQllURV9TV0FQX1NISUZUICAgICAgICAgICAgICAgICAgICgxOCkKKyNkZWZpbmUgU0NVX1BETUFfQ09ORklHVVJBVElPTl9CSUdfRU5ESUFOX0NPTlRST0xfQllURV9TV0FQX01BU0sgICAgICAgICAgICAgICAgICAgICgweDAwMDQwMDAwKQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX0JJR19FTkRJQU5fQ09OVFJPTF9YUElfU0dMX0ZFVENIX1NISUZUICAgICAgICAgICAgICAgKDE5KQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX0JJR19FTkRJQU5fQ09OVFJPTF9YUElfU0dMX0ZFVENIX01BU0sgICAgICAgICAgICAgICAgKDB4MDAwODAwMDApCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fQklHX0VORElBTl9DT05UUk9MX1hQSV9SWF9IRUFERVJfUkFNX1dSSVRFX1NISUZUICAgICAoMjApCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fQklHX0VORElBTl9DT05UUk9MX1hQSV9SWF9IRUFERVJfUkFNX1dSSVRFX01BU0sgICAgICAoMHgwMDEwMDAwMCkKKyNkZWZpbmUgU0NVX1BETUFfQ09ORklHVVJBVElPTl9CSUdfRU5ESUFOX0NPTlRST0xfWFBJX1VGX0FERFJFU1NfRkVUQ0hfU0hJRlQgICAgICAgICgyMSkKKyNkZWZpbmUgU0NVX1BETUFfQ09ORklHVVJBVElPTl9CSUdfRU5ESUFOX0NPTlRST0xfWFBJX1VGX0FERFJFU1NfRkVUQ0hfTUFTSyAgICAgICAgICgweDAwMjAwMDAwKQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX0FERFJFU1NfTU9ESUZJRVJfU0VMRUNUX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgKDIyKQorI2RlZmluZSBTQ1VfUERNQV9DT05GSUdVUkFUSU9OX0FERFJFU1NfTU9ESUZJRVJfU0VMRUNUX01BU0sgICAgICAgICAgICAgICAgICAgICAgICAgKDB4MDA0MDAwMDApCisjZGVmaW5lIFNDVV9QRE1BX0NPTkZJR1VSQVRJT05fUkVTRVJWRURfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMHhGRjgwMDAwMCkKKworI2RlZmluZSBTQ1VfUERNQUNSX0dFTl9WQUxVRShuYW1lLCB2YWx1ZSkgXAorCVNDVV9HRU5fVkFMVUUoU0NVX1BETUFfQ09ORklHVVJBVElPTl8gIyMgbmFtZSwgdmFsdWUpCisKKyNkZWZpbmUgU0NVX1BETUFDUl9HRU5fQklUKG5hbWUpIFwKKwlTQ1VfR0VOX0JJVChTQ1VfUERNQV9DT05GSUdVUkFUSU9OXyAjIyBuYW1lKQorCisjZGVmaW5lIFNDVV9QRE1BQ1JfQkVfR0VOX0JJVChuYW1lKSBcCisJU0NVX1BDTUFDUl9HRU5fQklUKEJJR19FTkRJQU5fQ09OVFJPTF8gIyMgbmFtZSkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyNkZWZpbmUgU0NVX0NETUFfQ09ORklHVVJBVElPTl9QQ0lfUkVMQVhFRF9PUkRFUklOR19FTkFCTEVfU0hJRlQgICAgICAgICAgICAgICAgICAgICg4KQorI2RlZmluZSBTQ1VfQ0RNQV9DT05GSUdVUkFUSU9OX1BDSV9SRUxBWEVEX09SREVSSU5HX0VOQUJMRV9NQVNLICAgICAgICAgICAgICAgICAgICAgKDB4MDAwMDAxMDApCisKKyNkZWZpbmUgU0NVX0NETUFDUl9HRU5fQklUKG5hbWUpIFwKKwlTQ1VfR0VOX0JJVChTQ1VfQ0RNQV9DT05GSUdVUkFUSU9OXyAjIyBuYW1lKQorCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogU0NVIExpbmsgTGF5ZXIgUmVnaXN0ZXJzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTQ1VfTElOS19MQVlFUl9TUEVFRF9ORUdPVElBVElPTl9USU1FUl9WQUxVRVNfVElNRU9VVF9TSElGVCAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgU0NVX0xJTktfTEFZRVJfU1BFRURfTkVHT1RJQVRJT05fVElNRVJfVkFMVUVTX1RJTUVPVVRfTUFTSyAgICAgICAgICAgICAgKDB4MDAwMDAwRkYpCisjZGVmaW5lIFNDVV9MSU5LX0xBWUVSX1NQRUVEX05FR09USUFUSU9OX1RJTUVSX1ZBTFVFU19MT0NLX1RJTUVfU0hJRlQgICAgICAgICAgICg4KQorI2RlZmluZSBTQ1VfTElOS19MQVlFUl9TUEVFRF9ORUdPVElBVElPTl9USU1FUl9WQUxVRVNfTE9DS19USU1FX01BU0sgICAgICAgICAgICAoMHgwMDAwRkYwMCkKKyNkZWZpbmUgU0NVX0xJTktfTEFZRVJfU1BFRURfTkVHT1RJQVRJT05fVElNRVJfVkFMVUVTX1JBVEVfQ0hBTkdFX0RFTEFZX1NISUZUICAgKDE2KQorI2RlZmluZSBTQ1VfTElOS19MQVlFUl9TUEVFRF9ORUdPVElBVElPTl9USU1FUl9WQUxVRVNfUkFURV9DSEFOR0VfREVMQVlfTUFTSyAgICAoMHgwMEZGMDAwMCkKKyNkZWZpbmUgU0NVX0xJTktfTEFZRVJfU1BFRURfTkVHT1RJQVRJT05fVElNRVJfVkFMVUVTX0RXT1JEX1NZTkNfVElNRU9VVF9TSElGVCAgKDI0KQorI2R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DUkVESVRfRVhIQVVTVEVEX1NISUZUICAgICAoNSkKKyNkZWZpbmUgU0NVX0xJTktfU1RBVFVTX1JFQ0VJVkVSX0NSRURJVF9FWEhBVVNURURfTUFTSyAgICAgICgweDAwMDAwMDIwKQorI2RlZmluZSBTQ1VfTElOS19TVEFUVVNfUkVTRVJWRURfTUFTSyAgICAgICAgICAgICAgICAgICAgICAgKDB4RkZGRkZGQ0QpCisKKyNkZWZpbmUgU0NVX1NBU19MTFNUQV9HRU5fQklUKG5hbWUpIFwKKwlTQ1VfR0VOX0JJVChTQ1VfTElOS19TVEFUVVNfICMjIG5hbWUpCisKKworLyogVE9ETzogV2hlcmUgaXMgdGhlIFNBVEFfUFNFTFRPViByZWdpc3Rlcj8gKi8KKworLyoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIFNDVSBTQVMgTWF4aW11bSBBcmJpdHJhdGlvbiBXYWl0IFRpbWUgVGltZW91dCBSZWdpc3RlcgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyNkZWZpbmUgU0NVX1NBU19NQVhfQVJCSVRSQVRJT05fV0FJVF9USU1FX1RJTUVPVVRfVkFMVUVfU0hJRlQgICAgICAgKDApCisjZGVmaW5lIFNDVV9TQVNfTUFYX0FSQklUUkFUSU9OX1dBSVRfVElNRV9USU1FT1VUX1ZBTFVFX01BU0sgICAgICAgICgweDAwMDA3RkZGKQorI2RlZmluZSBTQ1VfU0FTX01BWF9BUkJJVFJBVElPTl9XQUlUX1RJTUVfVElNRU9VVF9TQ0FMRV9TSElGVCAgICAgICAoMTUpCisjZGVmaW5lIFNDVV9TQVNfTUFYX0FSQklUUkFUSU9OX1dBSVRfVElNRV9USU1FT1VUX1NDQUxFX01BU0sgICAgICAgICgweDAwMDA4MDAwKQorC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VF9JREVOVElGSUNBVElPTl9EQV9TQVRBX0hPU1RfU0hJRlQgICAgICAgICAgKDgpCisjZGVmaW5lIFNDVV9TQVNfVFJBTlNNSVRfSURFTlRJRklDQVRJT05fREFfU0FUQV9IT1NUX01BU0sgICAgICAgICAgICgweDAwMDAwMTAwKQorI2RlZmluZSBTQ1VfU0FTX1RSQU5TTUlUX0lERU5USUZJQ0FUSU9OX1NNUF9JTklUSUFUT1JfU0hJRlQgICAgICAgICAoOSkKKyNkZWZpbmUgU0NVX1NBU19UUkFOU01JVF9JREVOVElGSUNBVElPTl9TTVBfSU5JVElBVE9SX01BU0sgICAgICAgICAgKDB4MDAwMDAyMDApCisjZGVmaW5lIFNDVV9TQVNfVFJBTlNNSVRfSURFTlRJRklDQVRJT05fU1RQX0lOSVRJQVRPUl9TSElGVCAgICAgICAgICgxMCkKKyNkZWZpbmUgU0NVX1NBU19UUkFOU01JVF9JREVOVElGSUNBVElPTl9TVFBfSU5JVElBVE9SX01BU0sgICAgICAgICAgKDB4MDAwMDA0MDApCisjZGVmaW5lIFNDVV9TQVNfVFJBTlNNSVRfSURFTlRJRklDQVRJT05fU1NQX0lOSVRJQVRPUl9TSElGVCAgICAgICAgICgxMSkKKyNkZWZpbmUgU0NVX1NBU19UUkFOU01JVF9JREVOVElGSUNBVElPTl9TU1BfSU5JVElBVE9SX01BU0sgICAgICAgICAgKDB4MDAwMDA4MDApCisjZGVmaW5lIFNDVV9TQVNfVFJBTlNNSVRfSURFTlRJRklDQVRJT05fUkVBU09OX0NPREVfU0hJRlQgICAgICAgICAgICgxNikKKyNkZWZpbmUgU0NVX1NBU19UUkFOU01JVF9JREVOVElGSUNBVElPTl9SRUFTT05fQ09ERV9NQVNLICAgICAgICAgICAgKDB4MDAwRjAwMDApCisjZGVmaW5lIFNDVV9TQVNfVFJBTlNNSVRfSURFTlRJRklDQVRJT05fQUREUkVTU19GUkFNRV9UWVBFX1NISUZUICAgICgyNCkKKyNkZWZpbmUgU0NVX1NBU19U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QX1ZJUlRVQUxfWk9OSU5HX0VYUEFOREVSX0NPTlRST0xfUkVTRVJWRURfTUFTSyAgICAgICAgICAgICAoMHg0NDQ0RkZDOSkKKworI2RlZmluZSBTQ1VfUEVHX1NDVVZaRUNSX0dFTl9WQUwobmFtZSwgdmFsKSBcCisJU0NVX0dFTl9WQUxVRShTQ1VfUFJPVE9DT0xfRU5HSU5FX0dST1VQX1ZJUlRVQUxfWk9OSU5HX0VYUEFOREVSX0NPTlRST0xfICMjIG5hbWUsIHZhbCkKKworI2RlZmluZSBTQ1VfUEVHX1NDVVZaRUNSX0dFTl9CSVQobmFtZSkgXAorCVNDVV9HRU5fQklUKFNDVV9QUk9UT0NPTF9FTkdJTkVfR1JPVVBfVklSVFVBTF9aT05JTkdfRVhQQU5ERVJfQ09OVFJPTF8gIyMgbmFtZSkKKworCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogUG9ydCBUYXNrIFNjaGVkdWxlciByZWdpc3RlcnMgc2hpZnQgYW5kIG1hc2sgdmFsdWVzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX0lUX05FWFVTX1RJTUVPVVRfU0hJRlQgICAgICgwKQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX0lUX05FWFVTX1RJTUVPVVRfTUFTSyAgICAgICgweDAwMDBGRkZGKQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX1RBU0tfVElNRU9VVF9TSElGVCAgICAgICAgICgxNikKKyNkZWZpbmUgU0NVX1BUU0dfQ09OVFJPTF9UQVNLX1RJTUVPVVRfTUFTSyAgICAgICAgICAoMHgwMEZGMDAwMCkKKyNkZWZpbmUgU0NVX1BUU0dfQ09OVFJPTF9QVFNHX0VOQUJMRV9TSElGVCAgICAgICAgICAoMjQpCisjZGVmaW5lIFNDVV9QVFNHX0NPTlRST0xfUFRTR19FTkFCTEVfTUFTSyAgICAgICAgICAgKDB4MDEwMDAwMDApCisjZGVmaW5lIFNDVV9QVFNHX0NPTlRST0xfRVRNX0VOQUJMRV9TSElGVCAgICAgICAgICAgKDI1KQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX0VUTV9FTkFCTEVfTUFTSyAgICAgICAgICAgICgweDAyMDAwMDAwKQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX0RFRkFVTFRfTUFTSyAgICAgICAgICAgICAgICgweDAwMDIwMDAyKQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX1JFUVVJUkVEX01BU0sgICAgICAgICAgICAgICgweDAwMDAwMDAwKQorI2RlZmluZSBTQ1VfUFRTR19DT05UUk9MX1JFU0VSVkVEX01BU0sgICAgICAgICAgICAgICgweEZDMDAwMDAwKQorCisjZGVmaW5lIFNDVV9QVFNHQ1JfR0VOX1ZBTChuYW1lLCB2YWwpIFwKKwlTQ1VfR0VOX1ZBTFVFKFNDVV9QVFNHX0NPTlRST0xfICMjIG5hbWUsIHZhbCkKKworI2RlZmluZSBTQ1VfUFRTR0NSX0dFTl9CSVQobmFtZSkgXAorCVNDVV9HRU5fQklUKFNDVV9QVFNHX0NPTlRST0xfICMjIG5hbWUpCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyNkZWZpbmUgU0NVX1BUU0dfUkVBTF9USU1FX0NMT0NLX1NISUZUICAgICAgICAgICgwKQorI2RlZmluZSBTQ1VfUFRTR19SRUFMX1RJTUVfQ0xPQ0tfTUFTSyAgICAgICAgICAgKDB4MDAwMEZGRkYpCisjZGVmaW5lIFNDVV9QVFNHX1JFQUxfVElNRV9DTE9DS19SRVNFUlZFRF9NQVNLICAoMHhGRkZGMDA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qKioqKioqKioqKioqKioqKioqCisgKiAqIFNHUElPIFJlZ2lzdGVyIHNoaWZ0IGFuZCBtYXNrIHZhbHVlcworICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fRU5BQkxFX1NISUZUICAgICAgICAgICAgICAgICAgICAoMCkKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fRU5BQkxFX01BU0sgICAgICAgICAgICAgICAgICAgICAoMHgwMDAwMDAwMSkKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fU0VSSUFMX0NMT0NLX1NFTEVDVF9TSElGVCAgICAgICAoMSkKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fU0VSSUFMX0NMT0NLX1NFTEVDVF9NQVNLICAgICAgICAoMHgwMDAwMDAwMikKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fU0VSSUFMX1NISUZUX1dJRFRIX1NFTEVDVF9TSElGVCAoMikKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fU0VSSUFMX1NISUZUX1dJRFRIX1NFTEVDVF9NQVNLICAoMHgwMDAwMDAwNCkKKyNkZWZpbmUgU0NVX1NHUElPX0NPTlRST0xfU0dQSU9fVEVTVF9CSVRfU0hJRlQgICAgICAgICAgICAgICAgICAoMTUpCisjZGVmaW5lIFNDVV9TR1BJT19DT05UUk9MX1NHUElPX1RFU1RfQklUX01BU0sgICAgICAgICAgICAgICAgICAgKDB4MDAwMDgwMDApCisjZGVmaW5lIFNDVV9TR1BJT19DT05UUk9MX1NHUElPX1JFU0VSVkVEX01BU0sgICAgICAgICAgICAgICAgICAgKDB4RkZGRjdGRjgpCisKKyNkZWZpbmUgU0NVX1NHSUNSeF9HRU5fQklUKG5hbWUpI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gU01BVyAqLworCXUzMiBtbXJfYWRkcmVzc193aW5kb3c7CisvKiAweDAwQTQgU01EVyAqLworCXUzMiBtbXJfZGF0YV93aW5kb3c7CisJdTMyIHJlc2VydmVkX0E4OworCXUzMiByZXNlcnZlZF9BQzsKKy8qIEEgd2hvbGUgYnVuY2ggb2YgcmVzZXJ2ZWQgc3BhY2UgKi8KKwl1MzIgcmVzZXJ2ZWRfQnhbNF07CisJdTMyIHJlc2VydmVkX0N4WzRdOworCXUzMiByZXNlcnZlZF9EeFs0XTsKKwl1MzIgcmVzZXJ2ZWRfRXhbNF07CisJdTMyIHJlc2VydmVkX0Z4WzRdOworCXUzMiByZXNlcnZlZF8xeHhbNjRdOworCXUzMiByZXNlcnZlZF8yeHhbNjRdOworCXUzMiByZXNlcnZlZF8zeHhbNjRdOworLyoKKyAqIEFjY2Vzc2FibGUgdG8gRk4jMCBvbmx5CisgKiAweDA0MDAgVENBICovCisJdTMyIHRhc2tfY29udGV4dF9hc3NpZ25tZW50WzI1Nl07CisvKiBNU0ktWCByZWdpc3RlcnMgbm90IGluY2x1ZGVkICovCit9OworCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFNETUEgUmVnaXN0ZXJzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTQ1VfU0RNQV9CQVNFICAgICAgICAgICAgICAgMHg2MDAwCisjZGVmaW5lIFNDVV9TRE1BX1BVRkFUTEhBUl9PRkZTRVQgICAweDAwMDAKKyNkZWZpbmUgU0NVX1NETUFfUFVGQVRVSEFSX09GRlNFVCAgIDB4MDAwNAorI2RlZmluZSBTQ1VfU0RNQV9VRkxIQkFSX09GRlNFVCAgICAgMHgwMDA4CisjZGVmaW5lIFNDVV9TRE1BX1VGVUhCQVJfT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NldCAweDgwICovCisJdTMyIHJlc2VydmVkXzAwMjBfMDA3Q1sweDE4XTsKKy8qIDB4MDA4MCBDRE1BQ1IgKi8KKwl1MzIgY2RtYV9jb25maWd1cmF0aW9uOworLyogUmVtYWluZGVyIFNETUEgcmVnaXN0ZXIgc3BhY2UgKi8KKwl1MzIgcmVzZXJ2ZWRfMDA4NF8wNDAwWzB4REZdOworCit9OworCisvKgorICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogU0NVIExpbmsgUmVnaXN0ZXJzCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworI2RlZmluZSBTQ1VfUEVHMF9PRkZTRVQgICAgMHgwMDAwCisjZGVmaW5lIFNDVV9QRUcxX09GRlNFVCAgICAweDgwMDAKKworI2RlZmluZSBTQ1VfVEwwX09GRlNFVCAgICAgMHgwMDAwCisjZGVmaW5lIFNDVV9UTDFfT0ZGU0VUICAgICAweDA0MDAKKyNkZWZpbmUgU0NVX1RMMl9PRkZTRVQgICAgIDB4MDgwMAorI2RlZmluZSBTQ1VfVEwzX09GRlNFVCAgICAgMHgwQzAwCisKKyNkZWZpbmUgU0NVX0xMX09GRlNFVCAgICAgIDB4MDA4MAorI2RlZmluZSBTQ1VfTEwwX09GRlNFVCAgICAgKFNDVV9UTDBfT0ZGU0VUICsgU0NVX0xMX09GRlNFVCkKKyNkZWZpbmUgU0NVX0xMMV9PRkZTRVQgICAgIChTQ1VfVEwxX09GRlNFVCArIFNDVV9MTF9PRkZTRVQpCisjZGVmaW5lIFNDVV9MTDJfT0ZGU0VUICAgICAoU0NVX1RMMl9PRkZTRVQgKyBTQ1VfTExfT0ZGU0VUKQorI2RlZmluZSBTQ1VfTEwzX09GRlNFVCAgICAgKFNDVV9UTDNfT0ZGU0VUICsgU0NVX0x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7CisvKiAweDAwMTQgU0dQSU9fU0dTSURVUiAqLworCXUzMiBzZXJpYWxfaW5wdXRfdXBwZXI7CisvKiAweDAwMTggU0dQSU9fU0dWU0NSICovCisJdTMyIHZlbmRvcl9zcGVjaWZpY19jb2RlOworLyogMHgwMDIwIFNHUElPX1NHT0RTUiAqLworCXUzMiBvdXB1dF9kYXRhX3NlbGVjdFs4XTsKKy8qIFJlbWFpbmRlciBvZiBtZW1vcnkgc3BhY2UgMjU2IGJ5dGVzICovCisJdTMyIHJlc2VydmVkXzE0NDRfMTRmZlsweDMxXTsKKworfTsKKworLyoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIERlZmluZXMgZm9yIFZJSVQgZW50cnkgb2Zmc2V0cworICogKiBBY2Nlc3MgYWRkaXRpb25hbCBlbnRyaWVzIGJ5IFNDVV9WSUlUX0JBU0UgKyBpbmRleCAqIDB4MTAKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisjZGVmaW5lICAgICBTQ1VfVklJVF9CQVNFICAgICAweDFjMDAKKworc3RydWN0IHNjdV92aWl0X3JlZ2lzdGVycyB7CisJdTMyIHJlZ2lzdGVyc1syNTZdOworfTsKKworLyoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIFNDVSBQT1JUIFRBU0sgU0NIRURVTEVSIFJFR0lTVEVSUworICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworI2RlZmluZSBTQ1VfUFRTR19CQVNFICAgICAgICAgICAgICAgMHgxMDAwCisKKyNkZWZpbmUgU0NVX1BUU0dfU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Nfc2Nhbm5pbmdfaW50ZXJ2YWxfY29udHJvbDsKKy8qIDB4MDA0NCBFVE1STlNDQ1IgKi8KKwl1MzIgcm5jX3NjYW5uaW5nX2ludGVydmFsX2NvbnRyb2w7CisvKiBSZW1haW5kZXIgb2YgbWVtb3J5IHNwYWNlIDEyOCBieXRlcyAqLworCXUzMiByZXNlcnZlZF8xMDQ4XzEwN2ZbMHgwRV07CisKK307CisKKyNkZWZpbmUgU0NVX1BUU0dfU0NVVlpFQ1JfT0ZGU0VUICAgICAgICAweDAwM0MKKworLyoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIEFGRSBSRUdJU1RFUlMKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisjZGVmaW5lIFNDVV9BRkVfTU1SX0JBU0UgICAgICAgICAgICAgICAgICAweEUwMDAKKworLyoKKyAqIEFGRSAwIGlzIGF0IG9mZnNldCAweDA4MDAKKyAqIEFGRSAxIGlzIGF0IG9mZnNldCAweDA5MDAKKyAqIEFGRSAyIGlzIGF0IG9mZnNldCAweDBhMDAKKyAqIEFGRSAzIGlzIGF0IG9mZnNldCAweDBiMDAgKi8KK3N0cnVjdCBzY3VfYWZlX3RyYW5zY2VpdmVyIHsKKwkvKiAweDAwMDAgQUZFX1hDVlJfQ1RSTDAgKi8KKwl1MzIgYWZlX3hjdnJfY29udHJvbDA7CisJLyogMHgwMDA0IEFGRV9YQ1ZSX0NUUkwxICovCisJdTMyIGFmZV94Y3ZyX2NvbnRyb2wxOworCS8qIDB4MDAwOCAqLworCXUzMiByZXNlcnZlZF8wMDA4OworCS8qIDB4MDAwYyBhZmVfZGZ4X3J4X2NvbnRyb2wwICovCisJdTMyIGFmZV9kZnhfcnhfY29udHJvbDA7CisJLyogMHgwMDEwIEFGRV9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1VfVEFTS19ET05FX0dPT0QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgwMCkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9DUkNfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MTQpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfQ0hFQ0tfUkVTUE9OU0UgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDE0KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0dFTl9SRVNQT05TRSAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxNSkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9OQUtfQ01EX0VSUiAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MTYpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfQ01EX0xMX1JfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDE2KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0xMX1JfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxNykKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9BQ0tfTkFLX1RPICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MTcpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfTExfUEVSUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDE4KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0xMX1NZX1RFUk0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxOSkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9OQUtfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MTkpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfTExfTEZfVEVSTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDFBKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0RBVEFfTEVOX0VSUiAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxQSkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9MTF9DTF9URVJNICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MUIpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfTExfQUJPUlRfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDFCKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1NFUV9JTlZfVFlQRSAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxQykKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9VTkVYUF9YUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MUMpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfSU5WX0ZJU19UWVBFICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDFEKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1hSX0lVX0xFTl9FUlIgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxRCkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9JTlZfRklTX0xFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MUUpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfWFJfV0RfTEVOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDFFKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1NETUFfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgxRikKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9PRkZTRVRfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MjApCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfTUFYX1BMRF9FUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDIxKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0VYQ0VTU19EQVRBICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyMikKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9MRl9FUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MjMpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfVU5FWFBfRklTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDI0KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1VORVhQX1JFU1AgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyNCkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9FQVJMWV9SRVNQICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MjUpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfU01QX1JFU1BfVE9fRVJSICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDI2KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0RNQVNFVFVQX0RJUkVSUiAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyNykKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9TTVBfVUZJX0VSUiAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MjcpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfWEZFUkNOVF9FUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDI4KQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1NNUF9GUk1fVFlQRV9FUlIgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyOCkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9TTVBfTExfUlhfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MjkpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfUkVTUF9MRU5fRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDJBKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1VORVhQX0RBVEEgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyQikKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9PUEVOX0ZBSUwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MkMpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfVU5FWFBfU0RCRklTICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDJEKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX1JFR19FUlIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh1MzIpMHgyRSkKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9TREJfRVJSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgodTMyKTB4MkYpCisjZGVmaW5lIFNDVV9UQVNLX0RPTkVfVEFTS19BQk9SVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHUzMikweDMwKQorI2RlZmluZSBTQ1VfVEFTS19ET05FX0NNRF9TRE1BX0VSUiAgICAgICAgICAgICAgICAgICAgICAgICAgKChVMzIpMHgzMikKKyNkZWZpbmUgU0NVX1RBU0tfRE9ORV9DTURfTExfQUJPUlRfRVJSICAgICAgICAgICAgICAgICAgICAgICgoVTMyKTB4MzMpCisjZGVmaW5lIFNDVV9UQVNLX09QRU5fUkVKRUNUX1dST05HX0RFU1RJTkFUSU9OICAgICAgICAgICAgICAoKHUzMikweDM0KQorI2RlZmluZSBTQ1VfVEFTS19PUEVOX1JFSkVDVF9SRVNFUlZFRF9BQkFORE9OXzEgICAgICAgICAgICAgKCh1MzIpMHgzNSkKKyNkZWZpbmUgU0NVX1RBU0tfT1BFTl9SRUpFQ1RfUkVTRVJWRURfQUJBTkRPTl8yICAgICAgICAgICAgICgodTMyKTB4MzYpCisjZGVmaW5lIFNDVV9UQVNLX09QRU5fUkVKRUNUX1JFU0VSVkVEX0FCQU5ET05fMyAgICAgICAgICAgICAoKHUzMikweDM3KQ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VudW0gbGVkX2JyaWdodG5lc3MJbmV3X2JyaWdodG5lc3M7CisJaW50CQkJaWQ7CisJaW50CQkJZmxhZ3M7Cit9OworCitzdGF0aWMgaW50IGFkcDg4NzBfcmVhZChzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LCBpbnQgcmVnLCB1aW50OF90ICp2YWwpCit7CisJaW50IHJldDsKKworCXJldCA9IGkyY19zbWJ1c19yZWFkX2J5dGVfZGF0YShjbGllbnQsIHJlZyk7CisJaWYgKHJldCA8IDApIHsKKwkJZGV2X2VycigmY2xpZW50LT5kZXYsICJmYWlsZWQgcmVhZGluZyBhdCAweCUwMnhcbiIsIHJlZyk7CisJCXJldHVybiByZXQ7CisJfQorCisJKnZhbCA9IHJldDsKKwlyZXR1cm4gMDsKK30KKworCitzdGF0aWMgaW50IGFkcDg4NzBfd3JpdGUoc3RydWN0IGkyY19jbGllbnQgKmNsaWVudCwgdTggcmVnLCB1OCB2YWwpCit7CisJaW50IHJldCA9IGkyY19zbWJ1c193cml0ZV9ieXRlX2RhdGEoY2xpZW50LCByZWcsIHZhbCk7CisJaWYgKHJldCkKKwkJZGV2X2VycigmY2xpZW50LT5kZXYsICJmYWlsZWQgdG8gd3JpdGVcbiIpOworCisJcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludCBhZHA4ODcwX3NldF9iaXRzKHN0cnVjdCBpMmNfY2xpZW50ICpjbGllbnQsIGludCByZWcsIHVpbnQ4X3QgYml0X21hc2spCit7CisJc3RydWN0IGFkcDg4NzBfYmwgKmRhdGEgPSBpMmNfZ2V0X2NsaWVudGRhdGEoY2xpZW50KTsKKwl1aW50OF90IHJlZ192YWw7CisJaW50IHJldDsKKworCW11dGV4X2xvY2soJmRhdGEtPmxvY2spOworCisJcmV0ID0gYWRwODg3MF9yZWFkKGNsaWVudCwgcmVnLCAmcmVnX3ZhbCk7CisKKwlpZiAoIXJldCAmJiAoKHJlZ192YWwgJiBiaXRfbWFzaykgPT0gMCkpIHsKKwkJc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