//
// sub_62F538 from 0x62f538 to 0x62f6ec (436 bytes)
//
// 2 xrefs:
// > sub_61E55C @ 0x61e57e
// > sub_62AEF4 @ 0x62b000
//
// 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_62F538(char *a1)
{
char *v3; // r9
int i; // r4
int v5; // r3
struct sigaction *v6; // r5
int v7; // r3
struct sigaction *v8; // r4
int v9; // r8
int v10; // r10
_DWORD *v11; // r4
_DWORD *v12; // r7
int v13; // [sp+4h] [bp-44h] BYREF
int v14; // [sp+8h] [bp-40h]
int v15; // [sp+Ch] [bp-3Ch]
int v16; // [sp+10h] [bp-38h]
int v17; // [sp+14h] [bp-34h] BYREF
int v18; // [sp+18h] [bp-30h]
int v19; // [sp+1Ch] [bp-2Ch]
int v20; // [sp+20h] [bp-28h]
unsigned __int8 v21; // [sp+24h] [bp-24h]
if ( !a1 || *(_DWORD *)a1 != 764702 )
return 1;
*(_DWORD *)a1 = 0;
v3 = a1 + 104;
for ( i = sub_63E50C(a1 + 104); i; i = sub_63E50C(v3) )
{
while ( 1 )
{
v5 = *((_DWORD *)a1 + 36);
*(_DWORD *)i = v5;
v21 = *(_BYTE *)(v5 + 932);
v6 = (struct sigaction *)v21;
if ( !v21 )
{
v17 = 0;
v18 = 0;
v19 = 0;
v20 = 0;
sigaction(13, nullptr, (struct sigaction *)&v17);
v14 = v18;
v15 = v19;
v16 = v20;
v13 = 1;
sigaction(13, (const struct sigaction *)&v13, v6);
}
*(_DWORD *)(*(_DWORD *)i + 8) = 0;
sub_62E0A4(i, 1);
sub_620F5C(i, 0);
if ( !v21 )
break;
i = sub_63E50C(v3);
if ( !i )
goto LABEL_11;
}
sigaction(13, (const struct sigaction *)&v17, nullptr);
}
LABEL_11:
v7 = *((_DWORD *)a1 + 36);
if ( v7 )
{
v21 = *(_BYTE *)(v7 + 932);
v8 = (struct sigaction *)v21;
if ( !v21 )
{
v17 = 0;
v18 = 0;
v19 = 0;
v20 = 0;
sigaction(13, nullptr, (struct sigaction *)&v17);
v14 = v18;
v15 = v19;
v16 = v20;
v13 = 1;
sigaction(13, (const struct sigaction *)&v13, v8);
v7 = *((_DWORD *)a1 + 36);
}
v9 = (int)(a1 + 44);
*(_DWORD *)(v7 + 56) = a1 + 44;
v10 = 1;
sub_6105B8(*((_DWORD *)a1 + 36), *(_DWORD *)(*((_DWORD *)a1 + 36) + 56));
sub_61E55C(*((_DWORD *)a1 + 36));
}
else
{
v10 = 0;
v9 = (int)(a1 + 44);
}
sub_62E55C((int)(a1 + 72));
sub_63E200(v3);
sub_62E200(*((_DWORD **)a1 + 5), 0);
sub_62E200(*((_DWORD **)a1 + 6), 0);
v11 = *((_DWORD **)a1 + 1);
if ( v11 )
{
do
{
while ( 1 )
{
v12 = (_DWORD *)*v11;
if ( v11[15] == 2 )
break;
v11[410] = 0;
v11[16] = 0;
v11 = v12;
if ( !v12 )
goto LABEL_20;
}
sub_6105B8((int)v11, v11[14]);
v11[14] = 0;
v11[15] = 0;
v11[410] = 0;
v11[16] = 0;
v11 = v12;
}
while ( v12 );
}
LABEL_20:
sub_62E55C(v9);
sub_63E714(0, a1 + 172);
sub_63E870(0, a1 + 176);
off_ABAEB0(a1);
if ( v10 )
{
if ( !v21 )
sigaction(13, (const struct sigaction *)&v17, nullptr);
}
return 0;
}