//
// sub_1002DBD38 from 0x1002dbd38 to 0x1002dbeb4 (380 bytes)
//
// 1 xrefs:
// > sub_1002DBBE0 @ 0x1002dbcc0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:02:45 +0000
//
_DWORD *__fastcall sub_1002DBD38(_DWORD *result, int a2)
{
unsigned int v2; // w10
unsigned int v3; // w12
unsigned int v4; // w15
int v5; // w11
__int64 v6; // x4
unsigned int *v7; // x3
char v8; // w5
__int64 v9; // x6
unsigned int v10; // w4
int v11; // w9
unsigned int v12; // w10
__int64 v13; // x10
__int64 v14; // x11
_DWORD *v15; // x12
if ( (byte_100A10930 & 1) == 0 )
{
v2 = 0;
v3 = dword_100A1092C;
v4 = dword_100A0F930[0];
v5 = 6;
do
{
v6 = 0;
v2 -= 1640531527;
v7 = (unsigned int *)&unk_100A0F934;
do
{
v8 = (v2 >> 2) ^ v6;
v9 = v6 + 1;
v10 = *v7;
v3 = ((((4 * v10) ^ (v3 >> 5)) + ((v10 >> 3) ^ (16 * v3))) ^ ((dword_100A0F920[v8 & 3] ^ v3) + (v10 ^ v2))) + v4;
*(v7++ - 1) = v3;
v4 = v10;
v6 = v9;
}
while ( v9 != 1023 );
v4 = dword_100A0F930[0];
v3 = ((((4 * v4) ^ (v3 >> 5)) + ((v4 >> 3) ^ (16 * v3))) ^ ((dword_100A0F920[~(v2 >> 2) & 3] ^ v3) + (v4 ^ v2)))
+ dword_100A1092C;
dword_100A1092C = v3;
--v5;
}
while ( v5 );
byte_100A10930 = 1;
}
v11 = 0;
v12 = a2 - 1;
if ( a2 < 1 )
{
LODWORD(v13) = 0;
}
else
{
if ( v12 >= 0x1FF )
v12 = 511;
v13 = v12 + 1;
v14 = v13;
v15 = result;
do
{
*v15++ ^= dword_100A0F930[v11];
if ( v11 <= 1022 )
++v11;
else
v11 = 0;
--v14;
}
while ( v14 );
}
if ( (int)v13 < a2 )
{
v13 = (unsigned int)v13;
do
{
result[v13] ^= dword_100A0F930[v11];
if ( v11 <= 1022 )
++v11;
else
v11 = 0;
v13 += 64;
}
while ( v13 < a2 );
}
return result;
}