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AgCisgICAgaWYgKGFyZ2MgPCAyKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiVXNhZ2U6ICVzIFxuIiwgYXJndlswXSk7CisgICAgICAgIHByaW50ZigiVXNhZ2U6ICVzIFxuIiwgYXJndlswXSk7CisgICAgICAgIHJldHVybiAxOworICAgIH0KKworICAgIGZpbGVuYW1lID0gYXJndlsxXTsKKyAgICBmaWxlID0gZm9wZW4oZmlsZW5hbWUsICJyYiIpOworICAgIHByaW50ZigiZm9wZW4gJyVzJyBlbmRcbiIsIGZpbGVuYW1lKTsgCisgICAgaWYgKCFmaWxlKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiVW5hYmxlIHRvIG9wZW4gZmlsZSAnJXMnXG4iLCBmaWxlbmFtZSk7CisgICAgICAgIHByaW50ZigiVW5hYmxlIHRvIG9wZW4gZmlsZSAnJXMnXG4iLCBmaWxlbmFtZSk7CisgICAgICAgIHJldHVybiAxOworICAgIH0KKworICAgIGZzZWVrKGZpbGUsIDAsIFNFRUtfU0VUKTsKKyAgICBsb25nIGJlZ2luID0gZnRlbGwoZmlsZSk7CisgICAgZnNlZWsoZmlsZSwgMCwgU0VFS19FTkQpOworICAgIGxvbmcgZW5kID0gZnRlbGwoZmlsZSk7CisgICAgbG9uZyBmaWxlX3NpemUgPSBlbmQgLSBiZWdpbjsvL9fWvdrK/QorICAgIGludCByZWFkX3RpbWVzID0gMDsKKyAgICBpbnQgcmVtYWluX3NpemUgPSAwOworCisgICAgZnNlZWsoZmlsZSwgMCwgU0VFS19TRVQpOy8v1tjQwtbDu9jOxLz+v6rNtworICAgIAorICAgIHByaW50ZigiekRydkF1ZGlvTWl4X09wZW4gc3RhcnQsIGZpbGUgc2l6ZSBpcyAlbGRcbiIsIGZpbGVfc2l6ZSk7ICAKKyAgICByZXQgPSB6RHJ2QXVkaW9NaXhfT3BlbigmdGVzdFBhcmFtKTsgCisgICAgaWYocmV0ICE9IDApCisgICAgICAgIHJldHVybiAxOworICAgIHByaW50ZigiekRydkF1ZGlvTWl4X09wZW4gZW5kXG4iKTsgCisKKyAgICB3aGlsZSAobW9yZV9jaHVua3MpeworICAgICAgICBtb3JlX2NodW5rcyA9IGZyZWFkKGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlciksIDEsIGZpbGUpOworICAgICAgICAKKyAgICAgICAgaWYobW9yZV9jaHVua3MgPT0gMSl7CisgICAgICAgICAgICByZWFkX3RpbWVzKys7CisgICAgICAgICAgICByZXQgPSB6RHJ2QXVkaW9NaXhfV3JpdGUoYnVmZmVyLCBzaXplb2YoYnVmZmVyKSk7CisgICAgICAgICAgICBpZihyZXQgIT0gMCkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBlbHNleyAKKyAgICAgICAgICAgIHJlbWFpbl9zaXplID0gZmlsZV9zaXplIC0gcmVhZF90aW1lcyAqIHNpemVvZihidWZmZXIpOworICAgICAgICAgICAgcHJpbnRmKCJtb3JlX2NodW5rcz0lZCwgcmVhZF90aW1lcz0lZCwgcmVtYWluX3NpemUgaXMgJWRcbiIsIG1vcmVfY2h1bmtzLCByZWFkX3RpbWVzLCByZW1haW5fc2l6ZSk7CisgICAgICAgICAgICBpZihyZW1haW5fc2l6ZSA9PSAwKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcmV0ID0gekRydkF1ZGlvTWl4X1dyaXRlKGJ1ZmZlciwgcmVtYWluX3NpemUpOworICAgICAgICAgICAgaWYocmV0ICE9IDApCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0gCisgICAgfSAKKyAgICBwcmludGYoIndoaWxlKG1vcmVfY2h1bmtzKSBlbmRcbiIpOyAKKworICAgIHJldCA9IHpEcnZBdWRpb01peF9DbG9zZSgpOworICAgIGlmKHJldCAhPSAwKQorICAgICAgICByZXR1cm4gMTsKKyAgICBwcmludGYoInpEcnZBdWRpb01peF9DbG9zZSBlbmRcbiIpOworICAgIGZjbG9zZShmaWxlKTsKKyAgICBwcmludGYoImZjbG9zZSBlbmRcbiIpOworCisgICAgcmV0dXJuIHJldDsKK30KKwo=