int key_from_seed(int s)
{
byte b = (byte)((s >> 0x10) & 0xFF);
byte b2 = (byte)((s >> 8) & 0xFF);
byte b3 = (byte)(s & 0xFF);
const int num = 0xBF;
const int num2 = 0xA4;
const int num3 = 0x90;
const int num4 = 0x56;
const int num5 = 0xCD;
int num6 = ((int)b << 0x10) + ((int)b2 << 8) + (int)b3;
int num7 = ((num6 & 0xFF0000) >> 0x10) | (num6 & 0xFF00) | (num << 0x18) | ((num6 & 0xFF) << 0x10);
int num8 = 0xC541A9;
for (int i = 0; i < 0x20; i++)
{
int num9 = (((num7 >> i) & 1) ^ (num8 & 1)) << 0x17;
int num11;
int num10;
num8 = ((num10 = (num11 = num9 | (num8 >> 1))) & 0xEF6FD7) | ((((num10 & 0x100000) >> 0x14) ^ ((num11 & 0x800000) >> 0x17)) << 0x14) | (((((num8 >> 1) & 0x8000) >> 0xF) ^ ((num11 & 0x800000) >> 0x17)) << 0xF) | (((((num8 >> 1) & 0x1000) >> 0xC) ^ ((num11 & 0x800000) >> 0x17)) << 0xC) | (0x20 * ((((num8 >> 1) & 0x20) >> 5) ^ ((num11 & 0x800000) >> 0x17))) | (8 * ((((num8 >> 1) & 8) >> 3) ^ ((num11 & 0x800000) >> 0x17)));
}
for (int i = 0; i < 0x20; i++)
{
int num9 = (((((num5 << 0x18) | (num4 << 0x10) | num2 | (num3 << 8)) >> i) & 1) ^ (num8 & 1)) << 0x17;
int num14;
int num13;
int num12 = (num13 = (num14 = num9 | (num8 >> 1)));
num8 = (num13 & 0xEF6FD7) | ((((num12 & 0x100000) >> 0x14) ^ ((num14 & 0x800000) >> 0x17)) << 0x14) | (((((num8 >> 1) & 0x8000) >> 0xF) ^ ((num14 & 0x800000) >> 0x17)) << 0xF) | (((((num8 >> 1) & 0x1000) >> 0xC) ^ ((num14 & 0x800000) >> 0x17)) << 0xC) | (0x20 * ((((num8 >> 1) & 0x20) >> 5) ^ ((num14 & 0x800000) >> 0x17))) | (8 * ((((num8 >> 1) & 8) >> 3) ^ ((num14 & 0x800000) >> 0x17)));
}
return ((num8 & 0xF0000) >> 0x10) | (0x10 * (num8 & 0xF)) | ((((num8 & 0xF00000) >> 0x14) | ((num8 & 0xF000) >> 8)) << 8) | ((num8 & 0xFF0) >> 4 << 0x10);
}