Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <climits>
- using namespace std;
- void seed_mt(unsigned int *result, int a2)
- {
- signed int v2; // r3@1
- signed int v3; // r1@1
- int v4; // r2@1
- unsigned int *v5; // r12@2
- int v6; // r4@2
- v2 = 623;
- result[1] = a2;
- v3 = 1;
- v4 = 0;
- do
- {
- v5 = &result[v4];
- --v2;
- ++v4;
- v6 = v3++ + 0x6C078965 * (v5[1] ^ (v5[1] >> 30));
- v5[2] = v6;
- }
- while ( v2 );
- *result = 0;
- }
- unsigned int nextuint32(unsigned int *a1)
- {
- signed int v1; // r1@1
- signed int v2; // r2@1
- unsigned int *v3; // r3@5
- unsigned int *v4; // r5@5
- unsigned int v5; // r2@5
- unsigned int v6; // r2@7
- unsigned int v7; // r0@7
- v1 = *a1 + 1;
- v2 = *a1 + 397;
- if ( v1 >= 624 )
- v1 = *a1 - 623;
- if ( v2 >= 624 )
- v2 = *a1 - 227;
- v3 = &a1[*a1];
- v4 = &a1[v2];
- v5 = (v3[1] & 0x80000000 | a1[v1 + 1] & 0x7FFFFFFF) >> 1;
- if ( a1[v1 + 1] & 1 )
- v5 ^= 0x9908B0DF;
- v6 = v5 ^ v4[1];
- v3[1] = v6;
- *a1 = v1;
- v7 = v6 ^ (v6 >> 11) ^ ((v6 ^ (v6 >> 11)) << 7) & 0x9D2C56FF;
- return v7 ^ (v7 << 15) & 0xEFC67FFF ^ ((v7 ^ (v7 << 15) & 0xEFC67FFF) >> 18);
- }
- void retwist(unsigned int*a1) {
- if (a1[0] == 0) {
- nextuint32(a1);
- }
- while (a1[0] != 0) {
- nextuint32(a1);
- }
- }
- int main() {
- unsigned int init = 0x0;
- unsigned int curr_index = 0x0;
- unsigned int current_table0 = 0x0;
- unsigned int*mt = new unsigned int[625];
- seed_mt(mt, init);
- int f = 0;
- while (true) {
- nextuint32(mt);
- f++;
- if (mt[0] == curr_index && mt[1] == current_table0) {
- break;
- }
- }
- cout << f << endl;
- delete mt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement