//
// sub_1006C83B0 from 0x1006c83b0 to 0x1006c881c (1132 bytes)
//
// 1 xrefs:
// > sub_1006C889C @ 0x1006c88b0
//
// 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:12:19 +0000
//
__int64 __fastcall sub_1006C83B0(int a1, unsigned int *a2, __int64 a3, _BYTE *a4)
{
__int64 v4; // x12
unsigned int v5; // w10
unsigned int v6; // w17
unsigned int v7; // w16
unsigned int v8; // w1
int v9; // w0
unsigned __int64 v10; // x8
__int64 v11; // x9
__int64 v12; // x10
_DWORD *v13; // x12
int v14; // w4
int v15; // t2
int v16; // w4
int v17; // w1
int v18; // w0
int v19; // w4
int v20; // t2
int v21; // w4
int v22; // w17
int v23; // w16
int v24; // w4
int v25; // t2
int v26; // w4
int v27; // w1
int v28; // w0
int v29; // w4
int v30; // t2
int v31; // w4
int v32; // w5
int v33; // w16
int v34; // w17
int v35; // t2
int v36; // w4
int v37; // w17
__int64 result; // x0
int v39; // w1
int v40; // w14
int v41; // w13
int v42; // w14
int v43; // w8
__int64 v44; // x9
int v45; // w8
int v46; // w10
int v47; // w11
v4 = 16 * a1;
v5 = _byteswap_ulong(a2[3]);
v6 = _byteswap_ulong(*a2) ^ *(_DWORD *)(a3 + 4 * v4);
v7 = _byteswap_ulong(a2[1]) ^ *(_DWORD *)(a3 + 4 * (v4 | 1));
v8 = _byteswap_ulong(a2[2]) ^ *(_DWORD *)(a3 + 4 * (v4 | 2));
v9 = v5 ^ *(_DWORD *)(a3 + 4 * (v4 | 3));
v10 = 4 * v4 - 64;
v11 = v4 - 16 - (v10 >> 2);
v12 = v4 - (v10 >> 2);
while ( 1 )
{
v13 = (_DWORD *)(a3 + v10);
v14 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(*(_WORD *)(a3 + v10 + 56) ^ v6) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(*(_BYTE *)(a3 + v10 + 56) ^ v6)]
^ dword_1007A23B8[(unsigned __int8)((*(_DWORD *)(a3 + v10 + 56) ^ v6) >> 16)]
^ dword_1007A1BB8[(*(_DWORD *)(a3 + v10 + 56) ^ v6) >> 24];
v15 = __ROR4__(v14, 8);
v16 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(*(_WORD *)(a3 + v10 + 60) ^ v7) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(*(_BYTE *)(a3 + v10 + 60) ^ v7)]
^ v14
^ dword_1007A27B8[(unsigned __int8)((*(_DWORD *)(a3 + v10 + 60) ^ v7) >> 16)]
^ dword_1007A23B8[(*(_DWORD *)(a3 + v10 + 60) ^ v7) >> 24];
v17 = v16 ^ v8;
v18 = v9 ^ v15 ^ v16;
v19 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(v17 ^ *(_WORD *)(a3 + v10 + 48)) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(v17 ^ *(_BYTE *)(a3 + v10 + 48))]
^ dword_1007A23B8[(unsigned __int8)(((unsigned int)v17 ^ *(_DWORD *)(a3 + v10 + 48)) >> 16)]
^ dword_1007A1BB8[((unsigned int)v17 ^ *(_DWORD *)(a3 + v10 + 48)) >> 24];
v20 = __ROR4__(v19, 8);
v21 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(v18 ^ *(_WORD *)(a3 + v10 + 52)) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(v18 ^ *(_BYTE *)(a3 + v10 + 52))]
^ v19
^ dword_1007A27B8[(unsigned __int8)(((unsigned int)v18 ^ *(_DWORD *)(a3 + v10 + 52)) >> 16)]
^ dword_1007A23B8[((unsigned int)v18 ^ *(_DWORD *)(a3 + v10 + 52)) >> 24];
v22 = v21 ^ v6;
v23 = v7 ^ v20 ^ v21;
v24 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(v22 ^ *(_WORD *)(a3 + v10 + 40)) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(v22 ^ *(_BYTE *)(a3 + v10 + 40))]
^ dword_1007A23B8[(unsigned __int8)(((unsigned int)v22 ^ *(_DWORD *)(a3 + v10 + 40)) >> 16)]
^ dword_1007A1BB8[((unsigned int)v22 ^ *(_DWORD *)(a3 + v10 + 40)) >> 24];
v25 = __ROR4__(v24, 8);
v26 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(v23 ^ *(_WORD *)(a3 + v10 + 44)) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(v23 ^ *(_BYTE *)(a3 + v10 + 44))]
^ v24
^ dword_1007A27B8[(unsigned __int8)(((unsigned int)v23 ^ *(_DWORD *)(a3 + v10 + 44)) >> 16)]
^ dword_1007A23B8[((unsigned int)v23 ^ *(_DWORD *)(a3 + v10 + 44)) >> 24];
v27 = v26 ^ v17;
v28 = v18 ^ v25 ^ v26;
v29 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(v27 ^ *(_WORD *)(a3 + v10 + 32)) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(v27 ^ *(_BYTE *)(a3 + v10 + 32))]
^ dword_1007A23B8[(unsigned __int8)(((unsigned int)v27 ^ *(_DWORD *)(a3 + v10 + 32)) >> 16)]
^ dword_1007A1BB8[((unsigned int)v27 ^ *(_DWORD *)(a3 + v10 + 32)) >> 24];
v30 = __ROR4__(v29, 8);
v31 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(v28 ^ *(_WORD *)(a3 + v10 + 36)) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(v28 ^ *(_BYTE *)(a3 + v10 + 36))]
^ v29
^ dword_1007A27B8[(unsigned __int8)(((unsigned int)v28 ^ *(_DWORD *)(a3 + v10 + 36)) >> 16)]
^ dword_1007A23B8[((unsigned int)v28 ^ *(_DWORD *)(a3 + v10 + 36)) >> 24];
v32 = v31 ^ v22;
v33 = v23 ^ v30 ^ v31;
v34 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(v32 ^ *(_WORD *)(a3 + v10 + 24)) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(v32 ^ *(_BYTE *)(a3 + v10 + 24))]
^ dword_1007A23B8[(unsigned __int8)(((unsigned int)v32 ^ *(_DWORD *)(a3 + v10 + 24)) >> 16)]
^ dword_1007A1BB8[((unsigned int)v32 ^ *(_DWORD *)(a3 + v10 + 24)) >> 24];
v35 = __ROR4__(v34, 8);
v36 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(v33 ^ *(_WORD *)(a3 + v10 + 28)) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(v33 ^ *(_BYTE *)(a3 + v10 + 28))]
^ v34
^ dword_1007A27B8[(unsigned __int8)(((unsigned int)v33 ^ *(_DWORD *)(a3 + v10 + 28)) >> 16)]
^ dword_1007A23B8[((unsigned int)v33 ^ *(_DWORD *)(a3 + v10 + 28)) >> 24];
v37 = v36 ^ v27;
result = v28 ^ v35 ^ (unsigned int)v36;
v39 = dword_1007A27B8[(unsigned __int8)((unsigned __int16)(v37 ^ *(_WORD *)(a3 + v10 + 16)) >> 8)]
^ dword_1007A1FB8[(unsigned __int8)(v37 ^ *(_BYTE *)(a3 + v10 + 16))]
^ dword_1007A23B8[(unsigned __int8)(((unsigned int)v37 ^ *(_DWORD *)(a3 + v10 + 16)) >> 16)]
^ dword_1007A1BB8[((unsigned int)v37 ^ *(_DWORD *)(a3 + v10 + 16)) >> 24];
v40 = dword_1007A1FB8[(unsigned __int8)((unsigned __int16)(result ^ *(_WORD *)(a3 + v10 + 20)) >> 8)]
^ dword_1007A1BB8[(unsigned __int8)(result ^ *(_BYTE *)(a3 + v10 + 20))]
^ v39
^ dword_1007A27B8[(unsigned __int8)(((unsigned int)result ^ *(_DWORD *)(a3 + v10 + 20)) >> 16)]
^ dword_1007A23B8[((unsigned int)result ^ *(_DWORD *)(a3 + v10 + 20)) >> 24];
v41 = v40 ^ v32;
v42 = v33 ^ __ROR4__(v39, 8) ^ v40;
if ( !v10 )
break;
v7 = v42 ^ __ROR4__(v13[2] & v41, 31);
v8 = (v13[1] | result) ^ v37;
v6 = (v7 | v13[3]) ^ v41;
v9 = result ^ __ROR4__(v8 & *v13, 31);
v10 -= 64LL;
}
v43 = *(_DWORD *)(a3 + 4 * v11);
v44 = a3 + 4 * v12;
v45 = v43 ^ v37;
v46 = *(_DWORD *)(v44 - 60) ^ result;
v47 = *(_DWORD *)(v44 - 56) ^ v41;
LODWORD(v44) = *(_DWORD *)(v44 - 52) ^ v42;
a4[3] = v45;
*a4 = HIBYTE(v45);
a4[1] = BYTE2(v45);
a4[2] = BYTE1(v45);
a4[7] = v46;
a4[11] = v47;
a4[4] = HIBYTE(v46);
a4[5] = BYTE2(v46);
a4[6] = BYTE1(v46);
a4[8] = HIBYTE(v47);
a4[9] = BYTE2(v47);
a4[10] = BYTE1(v47);
a4[12] = BYTE3(v44);
a4[13] = BYTE2(v44);
a4[14] = BYTE1(v44);
a4[15] = v44;
return result;
}