//
// sub_AFD80 from 0xafd80 to 0xafe0c (140 bytes)
//
// 3 xrefs:
// > sub_77974 @ 0x7797c
// > sub_B0E64 @ 0xb0e78
// > sub_B0F04 @ 0xb0f10
//
// 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 12:14:36 +0000
//
__int64 __fastcall sub_AFD80(__int64 a1, char a2, char a3)
{
__int64 *v4; // x0
__int64 v6; // x8
__int64 v7; // x9
v4 = *(__int64 **)(a1 + 544);
*(_DWORD *)(a1 + 568) = 1065353216;
sub_AAF7C(v4, a2 & 1, a3 & 1);
v6 = 0;
*(_DWORD *)(a1 + 88) = 0;
while ( v6 != 64 )
{
v7 = a1 + v6;
*(_DWORD *)(v7 + 616) = 0;
*(_QWORD *)(v7 + 608) = 0;
v6 += 16;
}
*(_DWORD *)(a1 + 680) = 1065353216;
*(_QWORD *)(a1 + 672) = 1;
*(_DWORD *)(a1 + 684) = 1;
if ( (a2 & 1) != 0 )
{
*(_QWORD *)(a1 + 552) = 0;
sub_AFED8(a1 + 8);
}
return 0;
}