//
// sub_7B650 from 0x7b650 to 0x7b6c2 (114 bytes)
//
// 1 xrefs:
// > sub_79FF0 @ 0x79ff0
//
// 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_7B650(int a1, int a2, unsigned int a3, int a4)
{
int v6; // r6
unsigned int v7; // r0
int v8; // r6
__int16 v9; // r5
if ( a4 == 2 )
{
v7 = *(_DWORD *)(a1 + 1516);
if ( v7 != a3 )
{
if ( v7 > a3 )
{
sub_4F22C(a1, 0);
v8 = 1;
}
else
{
v8 = 0;
}
while ( *(_DWORD *)(a1 + 1516) < a3 )
sub_7A02E(a1, 1);
if ( v8 )
{
v9 = *(_WORD *)(a1 + 2420);
sub_4F378(a1);
*(_WORD *)(a1 + 2420) = v9;
}
}
return 0;
}
else if ( a4 == 256 )
{
v6 = 0;
sub_4F22C(a1, 0);
*(_DWORD *)(a1 + 2456) = a3;
*(_DWORD *)(a1 + 2440) = a3;
}
else
{
return 19;
}
return v6;
}