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fQUxHX1RZUEVfTUFTSzsKCglyZXR1cm4gY3J5cHRvX2hhc19hbGcoYWxnX25hbWUsIHR5cGUsIG1hc2spOwp9CgpzdGF0aWMgaW5saW5lIGNvbnN0IGNoYXIgKmNyeXB0b19jb21wX25hbWUoc3RydWN0IGNyeXB0b19jb21wICp0Zm0pCnsKCXJldHVybiBjcnlwdG9fdGZtX2FsZ19uYW1lKGNyeXB0b19jb21wX3RmbSh0Zm0pKTsKfQoKc3RhdGljIGlubGluZSBzdHJ1Y3QgY29tcHJlc3NfdGZtICpjcnlwdG9fY29tcF9jcnQoc3RydWN0IGNyeXB0b19jb21wICp0Zm0pCnsKCXJldHVybiAmY3J5cHRvX2NvbXBfdGZtKHRmbSktPmNydF9jb21wcmVzczsKfQoKc3RhdGljIGlubGluZSBpbnQgY3J5cHRvX2NvbXBfY29tcHJlc3Moc3RydWN0IGNyeXB0b19jb21wICp0Zm0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpzcmMsIHVuc2lnbmVkIGludCBzbGVuLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqZHN0LCB1bnNpZ25lZCBpbnQgKmRsZW4pCnsKCXJldHVybiBjcnlwdG9fY29tcF9jcnQodGZtKS0+Y290X2NvbXByZXNzKGNyeXB0b19jb21wX3RmbSh0Zm0pLAoJCQkJCQkgIHNyYywgc2xlbiwgZHN0LCBkbGVuKTsKfQoKc3RhdGljIGlubGluZSBpbnQgY3J5cHRvX2NvbXBfZGVjb21wcmVzcyhzdHJ1Y3QgY3J5cHRvX2NvbXAgKnRmbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqc3JjLCB1bnNpZ25lZCBpbnQgc2xlbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1OCAqZHN0LCB1bnNpZ25lZCBpbnQgKmRsZW4pCnsKCXJldHVybiBjcn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