//
// sub_4F0BE from 0x4f0be to 0x4f126 (104 bytes)
//
// 2 xrefs:
// > sub_62B54 @ 0x62f46
// > sub_B0794 @ 0xb0814
//
// 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_4F0BE(_DWORD *a1, int *a2)
{
int v2; // r6
__int64 v5; // kr00_8
_DWORD *v6; // r5
int v7; // r0
v2 = *a2;
LABEL_2:
while ( a2 != (int *)v2 )
{
v5 = *(_QWORD *)v2;
*(_DWORD *)HIDWORD(v5) = v5;
*(_DWORD *)(*(_DWORD *)v2 + 4) = HIDWORD(v5);
*(_DWORD *)v2 = v2;
*(_DWORD *)(v2 + 4) = v2;
if ( *(_BYTE *)(v2 + 37) )
{
v6 = a1;
while ( 1 )
{
v6 = (_DWORD *)*v6;
if ( v6 == a1 )
break;
if ( !sub_BE2AA(v6[5], *(_DWORD *)(v2 + 20)) )
{
sub_4EEE8((int)v6, *(void **)(v2 + 24), *(_DWORD *)(v2 + 32));
sub_4EE74(v2);
v2 = v5;
goto LABEL_2;
}
}
}
v7 = a1[1];
*(_DWORD *)v2 = a1;
*(_DWORD *)(v2 + 4) = v7;
a1[1] = v2;
**(_DWORD **)(v2 + 4) = v2;
v2 = v5;
}
return 0;
}