//
// Poly1305_Update from 0xa3e984 to 0xa3ea40 (188 bytes)
//
// 8 xrefs:
// > sub_A13D1C @ 0xa13da0
// > sub_A13D1C @ 0xa13e4c
// > sub_A13D1C @ 0xa13eb0
// > sub_A13D1C @ 0xa13fd8
// > sub_A13D1C @ 0xa13ff0
// > sub_A13D1C @ 0xa14008
// > sub_A13D1C @ 0xa1401c
// > ??> @ 0x7cb6c
//
// 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:08:12 +0000
//
_DWORD *__fastcall Poly1305_Update(_DWORD *result, char *a2, size_t a3)
{
int v3; // r6
int v4; // r5
int (__fastcall *v5)(int, int, int, int); // r9
char *v6; // r7
size_t v7; // r4
int v8; // r8
char *v9; // r0
size_t v10; // r6
unsigned int v11; // r4
v3 = result[56];
v4 = (int)result;
v5 = (int (__fastcall *)(int, int, int, int))result[57];
v6 = a2;
v7 = a3;
if ( v3 )
{
v8 = 16 - v3;
v9 = (char *)result + v3 + 208;
if ( a3 < 16 - v3 )
{
result = memcpy(v9, a2, a3);
*(_DWORD *)(v4 + 224) = v7 + v3;
return result;
}
memcpy(v9, a2, 16 - v3);
v6 += v8;
v7 -= v8;
result = (_DWORD *)v5(v4, v4 + 208, 16, 1);
}
v10 = v7 & 0xF;
v11 = v7 - v10;
if ( v11 > 0xF )
{
result = (_DWORD *)v5(v4, (int)v6, v11, 1);
v6 += v11;
}
if ( v10 )
{
result = memcpy((void *)(v4 + 208), v6, v10);
*(_DWORD *)(v4 + 224) = v10;
}
else
{
*(_DWORD *)(v4 + 224) = 0;
}
return result;
}