//
// sub_767A40 from 0x767a40 to 0x767a9c (92 bytes)
//
// 8 xrefs:
// > sub_76A1F8 @ 0x76a210
// > sub_76AEE0 @ 0x76aef8
// > sub_76B594 @ 0x76b62e
// > sub_76B8A0 @ 0x76b8b8
// > sub_76BF44 @ 0x76bf5c
// > sub_76C5CC @ 0x76c5e4
// > sub_76CCB4 @ 0x76cccc
// > sub_76D404 @ 0x76d41c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_767A40(int a1, int *a2)
{
int v3; // r0
int v4; // r6
int v5; // r4
int result; // r0
unsigned int *v7; // r0
unsigned int *v8; // r7
v3 = sub_756B58(&dword_ACDD84);
v4 = *(_DWORD *)(*a2 + 12);
v5 = v3;
result = *(_DWORD *)(v4 + 4 * v3);
if ( !result )
{
v7 = (unsigned int *)operator new(0x128u);
v7[1] = 0;
v7[2] = 0;
v7[3] = 0;
*v7 = (unsigned int)&off_A2E450;
v8 = v7;
*((_BYTE *)v7 + 16) = 0;
v7[5] = 0;
v7[6] = 0;
v7[7] = 0;
v7[8] = 0;
v7[9] = 0;
v7[10] = 0;
*((_BYTE *)v7 + 292) = 0;
sub_7646A8((int)v7, (int)a2);
sub_756A4C(*a2, v8, v5);
return *(_DWORD *)(v4 + 4 * v5);
}
return result;
}