//
// sub_62D4BC from 0x62d4bc to 0x62d582 (198 bytes)
//
// 2 xrefs:
// > sub_62D9B8 @ 0x62dc8c
// > sub_62D9B8 @ 0x62dde0
//
// 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_62D4BC(int a1, int a2, int a3)
{
int v3; // r8
int v5; // r6
int v6; // r11
int v8; // r3
int v9; // r7
_DWORD *v10; // r4
int v11; // r9
int *v12; // r10
int v13; // r3
v3 = a1 + 4 * a3;
v5 = *(_DWORD *)(v3 + 424);
*(_DWORD *)(v3 + 424) = -1;
if ( a2 )
goto LABEL_2;
v8 = *(_DWORD *)(v3 + 80);
if ( v8 )
{
v9 = *(_DWORD *)(v8 + 4);
v10 = *(_DWORD **)(v8 + 28);
}
else
{
v13 = *(_DWORD *)(a1 + 80);
if ( !v13 )
goto LABEL_2;
v10 = *(_DWORD **)(v13 + 28);
if ( *(_DWORD *)(v13 + 4) == 2 )
v9 = 10;
else
v9 = 2;
}
if ( !v10 )
{
LABEL_2:
v6 = 7;
goto LABEL_3;
}
v11 = a3 ^ 1;
v12 = (int *)(a1 + 4 * (a3 + 106));
while ( 1 )
{
if ( *(_DWORD *)(a1 + 4 * (v11 + 20)) )
{
while ( v9 != v10[1] )
{
v10 = (_DWORD *)v10[7];
if ( !v10 )
goto LABEL_2;
}
}
v6 = sub_62CC48(a1, v10, v12);
if ( v6 != 7 )
break;
v10 = (_DWORD *)v10[7];
if ( !v10 )
goto LABEL_2;
}
*(_DWORD *)(v3 + 80) = v10;
LABEL_3:
if ( v5 == -1 )
return v6;
if ( !*(_DWORD *)(a1 + 56) )
{
LABEL_8:
sub_62F738(a1, v5);
close(v5);
return v6;
}
if ( v5 == *(_DWORD *)(a1 + 420) && *(_BYTE *)(a1 + 433) )
{
*(_BYTE *)(a1 + 433) = 0;
goto LABEL_8;
}
sub_62F738(a1, v5);
(*(void (__fastcall **)(_DWORD, int))(a1 + 56))(*(_DWORD *)(a1 + 60), v5);
return v6;
}