//
// BLAKE2b_Update from 0xaf3510 to 0xaf35d4 (196 bytes)
//
// 2 xrefs:
// > sub_ADE0A4 @ 0xade0c0
// > ??> @ 0x8540c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:10:59 +0000
//
int __fastcall BLAKE2b_Update(char *a1, char *a2, size_t a3)
{
int v3; // r3
int v5; // r7
size_t v6; // r4
char *v7; // r6
int v8; // r3
size_t v9; // r7
unsigned int v10; // r2
v3 = *((_DWORD *)a1 + 56);
v5 = 128 - v3;
v6 = a3;
v7 = a2;
if ( 128 - v3 < a3 )
{
if ( v3 )
{
memcpy(&a1[v3 + 96], a2, 128 - v3);
v6 -= v5;
sub_AEB090((__int64 *)a1, a1 + 96, 0x80u);
*((_DWORD *)a1 + 56) = 0;
v7 += v5;
if ( v6 <= 0x80 )
{
v3 = 0;
goto LABEL_8;
}
}
else if ( a3 <= 0x80 )
{
v3 = 0;
goto LABEL_8;
}
v8 = v6 & 0x7F;
if ( (v6 & 0x7F) == 0 )
v8 = 128;
v9 = v6 - v8;
v10 = v6 - v8;
v6 = v8;
sub_AEB090((__int64 *)a1, v7, v10);
v3 = *((_DWORD *)a1 + 56);
v7 += v9;
}
LABEL_8:
memcpy(&a1[v3 + 96], v7, v6);
*((_DWORD *)a1 + 56) += v6;
return 1;
}