signed
int
__fastcall sub_35D0(unsigned
int
*
a1, signed
int
a2)
{
unsigned
int
*
v2;
/
/
r10
signed
int
v3;
/
/
r8
_BYTE
*
v4;
/
/
r5
int
*
v5;
/
/
r0
int
*
v6;
/
/
r4
void
*
v7;
/
/
r0
int
v8;
/
/
r3
int
v9;
/
/
r6
int
v10;
/
/
r1
int
v11;
/
/
r2
signed
int
v12;
/
/
r5
signed
int
v13;
/
/
r1
int
v14;
/
/
r3
int
v15;
/
/
r8
unsigned
int
v16;
/
/
r7
unsigned
int
v17;
/
/
r4
int
v18;
/
/
r10
unsigned
int
v19;
/
/
lr
unsigned
int
*
v20;
/
/
r6
signed
int
v21;
/
/
r11
int
v22;
/
/
r5
unsigned
int
v23;
/
/
r1
int
v24;
/
/
r2
unsigned
int
v25;
/
/
r0
unsigned
int
v26;
/
/
r3
_DWORD
*
v27;
/
/
r2
int
v28;
/
/
r2
unsigned
int
*
v29;
/
/
r6
int
v30;
/
/
r2
int
v32;
/
/
r6
signed
int
v33;
/
/
r7
unsigned
int
v34;
/
/
r5
int
v35;
/
/
r3
int
v36;
/
/
r9
unsigned
int
v37;
/
/
r2
unsigned
int
v38;
/
/
r8
unsigned
int
*
v39;
/
/
r11
unsigned
int
*
v40;
/
/
r7
int
v41;
/
/
r6
unsigned
int
v42;
/
/
r1
unsigned
int
v43;
/
/
r0
_DWORD
*
v44;
/
/
r3
unsigned
int
v45;
/
/
r12
unsigned
int
*
v46;
/
/
r12
int
v47;
/
/
r0
int
v48;
/
/
r0
unsigned
int
*
v49;
/
/
[sp
+
0h
] [bp
-
48h
]
int
v50;
/
/
[sp
+
0h
] [bp
-
48h
]
signed
int
v51;
/
/
[sp
+
4h
] [bp
-
44h
]
int
v52;
/
/
[sp
+
4h
] [bp
-
44h
]
unsigned
int
*
v53;
/
/
[sp
+
8h
] [bp
-
40h
]
unsigned
int
*
v54;
/
/
[sp
+
8h
] [bp
-
40h
]
unsigned
int
v55;
/
/
[sp
+
Ch] [bp
-
3Ch
]
char v56;
/
/
[sp
+
10h
] [bp
-
38h
]
char v57;
/
/
[sp
+
11h
] [bp
-
37h
]
char v58;
/
/
[sp
+
12h
] [bp
-
36h
]
char v59;
/
/
[sp
+
13h
] [bp
-
35h
]
char v60;
/
/
[sp
+
14h
] [bp
-
34h
]
char v61;
/
/
[sp
+
15h
] [bp
-
33h
]
char v62;
/
/
[sp
+
16h
] [bp
-
32h
]
char v63;
/
/
[sp
+
17h
] [bp
-
31h
]
char v64;
/
/
[sp
+
18h
] [bp
-
30h
]
char v65;
/
/
[sp
+
19h
] [bp
-
2Fh
]
char v66;
/
/
[sp
+
1Ah
] [bp
-
2Eh
]
char v67;
/
/
[sp
+
1Bh
] [bp
-
2Dh
]
char v68;
/
/
[sp
+
1Ch
] [bp
-
2Ch
]
char v69;
/
/
[sp
+
1Dh
] [bp
-
2Bh
]
char v70;
/
/
[sp
+
1Eh
] [bp
-
2Ah
]
char v71;
/
/
[sp
+
1Fh
] [bp
-
29h
]
_DWORD v72[
1
];
/
/
[sp
+
20h
] [bp
-
28h
]
v2
=
a1;
v3
=
a2;
v51
=
a2;
v4
=
malloc(
8u
);
v5
=
(
int
*
)malloc(
8u
);
*
v4
=
79
;
v4[
2
]
=
84
;
v4[
3
]
=
108
;
v6
=
v5;
*
(_BYTE
*
)v5
=
0x59
;
*
((_BYTE
*
)v5
+
1
)
=
0x77
;
*
((_BYTE
*
)v5
+
2
)
=
0x60
;
*
((_BYTE
*
)v5
+
3
)
=
0x72
;
v4[
4
]
=
78
;
v4[
7
]
=
85
;
*
((_BYTE
*
)v5
+
4
)
=
0x62
;
*
((_BYTE
*
)v5
+
5
)
=
0x42
;
*
((_BYTE
*
)v5
+
6
)
=
0x76
;
v4[
1
]
=
0x6F
;
*
((_BYTE
*
)v5
+
7
)
=
0x6F
;
v7
=
v4;
v4[
5
]
=
0x49
;
v4[
6
]
=
0x49
;
v8
=
*
(_DWORD
*
)v4 ^
0x3030303
;
v9
=
*
v6 ^
0x1010101
;
v10
=
*
((_DWORD
*
)v4
+
1
) ^
0x3030303
;
v11
=
v6[
1
] ^
0x1010101
;
*
((_DWORD
*
)v4
+
1
)
=
v10;
v6[
1
]
=
v11;
*
(_DWORD
*
)v4
=
v8;
*
v6
=
v9;
v64
=
v10;
v58
=
BYTE1(v8);
v56
=
v8;
v60
=
BYTE2(v8);
v62
=
HIBYTE(v8);
v59
=
BYTE1(v9);
v57
=
v9;
v61
=
BYTE2(v9);
v63
=
HIBYTE(v9);
v65
=
v11;
v66
=
BYTE1(v10);
v67
=
BYTE1(v11);
v69
=
BYTE2(v11);
v12
=
v3;
v71
=
HIBYTE(v11);
v68
=
BYTE2(v10);
v70
=
HIBYTE(v10);
free(v7);
free(v6);
if
( v3 >
1
)
{
v13
=
v3;
v14
=
v3
+
0x3FFFFFFF
;
v15
=
v3
-
1
;
v16
=
0
;
v17
=
v2[v14];
v53
=
&v2[v14];
v49
=
v2;
v18
=
v12
-
2
;
v55
=
0x9E3779B9
*
(
52
/
v13)
-
0x4AB325AA
;
do
{
v16
-
=
0x61C88647
;
v19
=
v16 >>
2
;
if
( v51 <
=
3
)
{
v22
=
0
;
}
else
{
v20
=
v49;
v21
=
1
;
v22
=
0
;
v23
=
*
v49;
do
{
v24
=
((unsigned __int8)v22 ^ (unsigned __int8)v19) &
3
;
v25
=
v20[
1
];
v22
+
=
2
;
v20
+
=
2
;
v26
=
(((v25 ^ v16)
+
(v17 ^ v72[v24
-
4
])) ^ ((
16
*
v17 ^ (v25 >>
3
))
+
((v17 >>
5
) ^
4
*
v25)))
+
v23;
v27
=
&v72[((unsigned __int8)v21 ^ (unsigned __int8)v19) &
3
];
v23
=
*
v20;
v21
+
=
2
;
v28
=
*
(v27
-
4
);
*
(v20
-
2
)
=
v26;
v17
=
(((
4
*
v23 ^ (v26 >>
5
))
+
((v23 >>
3
) ^
16
*
v26)) ^ ((v26 ^ v28)
+
(v23 ^ v16)))
+
v25;
*
(v20
-
1
)
=
v17;
}
while
( v21 < v18 );
}
v29
=
&v49[v22];
do
{
v30
=
((unsigned __int8)v22
+
+
^ (unsigned __int8)v19) &
3
;
v17
=
*
v29
+
(((v17 ^ v72[v30
-
4
])
+
(v29[
1
] ^ v16)) ^ (((v17 >>
5
) ^
4
*
v29[
1
])
+
(
16
*
v17 ^ (v29[
1
] >>
3
))));
*
v29
=
v17;
+
+
v29;
}
while
( v22 < v15 );
v17
=
(((v17 ^ v72[(((unsigned __int8)v19 ^ (unsigned __int8)v15) &
3
)
-
4
])
+
(v16 ^
*
v49)) ^ ((
4
*
*
v49 ^ (v17 >>
5
))
+
((
*
v49 >>
3
) ^
16
*
v17)))
+
*
v53;
*
v53
=
v17;
}
while
( v16 !
=
v55 );
return
1
;
}
if
( (v51
+
1
<
0
) ^ __OFADD__(v51,
1
) )
{
v32
=
-
v51;
v33
=
v51;
v34
=
0x9E3779B9
*
(
52
/
-
v51
+
6
);
if
( v34 )
{
v35
=
~v51;
v50
=
~v51;
v54
=
&v2[~v51];
v52
=
~v51
-
1
;
v36
=
~v33
-
1
;
v37
=
*
v2;
v38
=
v34 >>
2
;
v39
=
&v2[v32
+
0x3FFFFFFF
];
if
( ~v33 <
=
2
)
goto LABEL_22;
LABEL_16:
v40
=
v54;
v41
=
v35;
v42
=
*
v54;
do
{
v43
=
*
(v40
-
1
);
v44
=
&v72[((unsigned __int8)v36 ^ (unsigned __int8)v38) &
3
];
v36
-
=
2
;
v45
=
v42
-
(((v37 ^ v34)
+
(v72[(((unsigned __int8)v41 ^ (unsigned __int8)v38) &
3
)
-
4
] ^ v43)) ^ (((v37 >>
3
) ^
16
*
v43)
+
(
4
*
v37 ^ (v43 >>
5
))));
v2[v41]
=
v45;
v42
=
*
(v40
-
2
);
v41
-
=
2
;
v40
-
=
2
;
v37
=
v43
-
((((v42 >>
5
) ^
4
*
v45)
+
(
16
*
v42 ^ (v45 >>
3
))) ^ ((
*
(v44
-
4
) ^ v42)
+
(v45 ^ v34)));
v40[
1
]
=
v37;
}
while
( v36 >
1
);
while
(
1
)
{
v46
=
&v2[v41];
do
{
v47
=
v72[(((unsigned __int8)v41
-
-
^ (unsigned __int8)v38) &
3
)
-
4
];
v37
=
*
v46
-
(((
*
(v46
-
1
) ^ v47)
+
(v37 ^ v34)) ^ (((v37 >>
3
) ^
16
*
*
(v46
-
1
))
+
(
4
*
v37 ^ (
*
(v46
-
1
) >>
5
))));
*
v46
=
v37;
-
-
v46;
}
while
( v41 );
v48
=
v37 ^ v34;
v34
+
=
0x61C88647
;
v37
=
*
v2
-
(((v72[(v38 &
3
)
-
4
] ^
*
v39)
+
v48) ^ ((
16
*
*
v39 ^ (v37 >>
3
))
+
((
*
v39 >>
5
) ^
4
*
v37)));
*
v2
=
v37;
if
( !v34 )
break
;
v35
=
v50;
v36
=
v52;
v38
=
v34 >>
2
;
if
( v50 >
2
)
goto LABEL_16;
LABEL_22:
v41
=
v35;
}
}
return
1
;
}
return
0
;
}