//
// aes_v8_set_decrypt_key from 0x1084700 to 0x1084768 (104 bytes)
//
// 4 xrefs:
// > sub_102036C @ 0x1020534
// > sub_1020AA0 @ 0x1020b24
// > sub_102262C @ 0x10227d4
// > ??> @ 0x7b310
//
// 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
//
__int64 __fastcall aes_v8_set_decrypt_key(
int8x16_t *a1,
int a2,
int8x16_t *a3,
double a4,
double a5,
double a6,
double a7,
int8x16_t a8)
{
__int64 result; // x0
__int64 v9; // x2
__int64 v10; // x12
_OWORD *v11; // x2
__int128 *v12; // x0
__int128 v13; // q1
uint8x16_t *v14; // x0
uint8x16_t *v15; // x2
uint8x16_t v16; // q1
result = aes_v8_set_encrypt_key(a1, a2, a3, a4, a5, a6, a7, a8);
if ( !result )
{
v11 = (_OWORD *)(v9 - 240);
v12 = &v11[v10];
v13 = *v12;
*v12 = *v11;
v14 = (uint8x16_t *)(v12 - 1);
*v11 = v13;
v15 = (uint8x16_t *)(v11 + 1);
do
{
v16 = vaesimcq_u8(*v14);
*v14-- = vaesimcq_u8(*v15);
*v15++ = v16;
}
while ( v14 > v15 );
*v14 = vaesimcq_u8(*v15);
return 0;
}
return result;
}