//
// sub_BB480 from 0xbb480 to 0xbb50a (138 bytes)
//
// 2 xrefs:
// > sub_BB510 @ 0xbb67c
// > sub_BB750 @ 0xbb86e
//
// 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_BB480(int *a1)
{
int v2; // r0
int v3; // r6
unsigned int v4; // r1
unsigned int v5; // r5
int v6; // r1
int v7; // r5
int v8; // r6
int v9; // r0
void (__fastcall *v10)(int, int, int); // r3
if ( (a1[91] & 8) != 0 )
{
while ( 1 )
{
v2 = a1[90];
__dmb(0xBu);
if ( !v2 )
break;
j_FMOD_OS_Time_Sleep(10);
}
}
v3 = *a1;
v4 = a1[79];
v5 = a1[83];
a1[91] &= ~0x40u;
a1[82] = 0;
a1[101] = 0;
a1[80] = 0;
v6 = v5 % v4;
v7 = v5 - v6;
a1[78] = v6;
a1[84] = v7;
a1[85] = v7;
a1[91] &= ~0x80u;
v8 = (*(int (__fastcall **)(int *, int))(v3 + 32))(a1, v7);
v9 = a1[92];
if ( v9 )
{
v10 = *(void (__fastcall **)(int, int, int))(v9 + 69048);
if ( v10 )
v10(a1[7], v7, a1[6]);
}
return v8;
}