//
// aes_v8_decrypt from 0x10847e0 to 0x1084830 (80 bytes)
//
// 5 xrefs:
// > ??> @ 0x45ac0
// > sub_102036C @ 0x1020544
// > sub_1020AA0 @ 0x1020b2c
// > sub_102262C @ 0x10227f4
// > ??> @ 0x1541508
//
// 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 13:17:12 +0000
//
long double __fastcall aes_v8_decrypt(uint8x16_t *a1, int8x16_t *a2, uint8x16_t *a3)
{
__int32 v3; // w3
uint8x16_t *v4; // x2
uint8x16_t v5; // q0
uint8x16_t v6; // q2
int v7; // w3
int8x16_t *v8; // x2
uint8x16_t v9; // q1
uint8x16_t v10; // q2
int8x16_t *v11; // x2
bool v12; // vf
uint8x16_t v13; // q2
long double result; // q0
v3 = a3[15].n128_i32[0];
v5 = *a3;
v4 = a3 + 1;
v6 = *a1;
v7 = v3 - 2;
v9 = *v4;
v8 = v4 + 1;
do
{
v10 = vaesimcq_u8(vaesdq_u8(v6, v5));
v5 = *v8;
v11 = v8 + 1;
v12 = __OFSUB__(v7, 2);
v7 -= 2;
v6 = vaesimcq_u8(vaesdq_u8(v10, v9));
v9 = *v11;
v8 = v11 + 1;
}
while ( !((v7 < 0) ^ v12 | (v7 == 0)) );
v13 = vaesimcq_u8(vaesdq_u8(v6, v5));
result = *(long double *)v8;
*a2 = veorq_s8(vaesdq_u8(v13, v9), *v8);
return result;
}