//
// sub_100604C80 from 0x100604c80 to 0x100604e2c (428 bytes)
//
// 2 xrefs:
// > sub_1005834D0 @ 0x100583cb0
// > sub_1006050BC @ 0x100605334
//
// 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
//
__int64 __fastcall sub_100604C80(__int64 a1, __int64 a2, int a3)
{
void *v6; // x0
_QWORD *v7; // x0
_DWORD *v8; // x19
__int64 v9; // x22
__int64 v10; // x21
__int16 v11; // w2
int v12; // w4
__int64 v13; // x0
__int16 v14; // w2
int v15; // w4
__int16 v16; // w0
if ( !a2 )
return 1;
v6 = sub_1005DB7B0();
v7 = sub_1005DA484((__int64)v6);
v8 = v7;
if ( !v7 || sub_1005DAB78(v7, 108, 3, a2) <= 0 )
{
v11 = 2;
v12 = 196;
goto LABEL_8;
}
if ( a3 != 2 )
{
if ( a3 != 1 )
{
v14 = 100;
v15 = 232;
LABEL_19:
sub_1005E0E48(11, 112, v14, (__int64)"by_file.c", v15);
v10 = 0;
LABEL_24:
sub_1005DA554(v8);
return v10;
}
v13 = sub_1005FE744((__int64)v8, 0, 0, 0);
v10 = 0;
while ( 1 )
{
v9 = v13;
if ( !v13 )
break;
if ( !(unsigned int)sub_1006037C4(*(_QWORD *)(a1 + 24), v13) )
{
v10 = 0;
goto LABEL_16;
}
v10 = (unsigned int)(v10 + 1);
sub_1005F4000(v9);
v13 = sub_1005FE744((__int64)v8, 0, 0, 0);
}
v16 = sub_1005E146C();
if ( (int)v10 >= 1 && (v16 & 0xFFF) == 0x6C )
{
sub_1005E1158();
goto LABEL_23;
}
v11 = 9;
v12 = 209;
LABEL_8:
sub_1005E0E48(11, 112, v11, (__int64)"by_file.c", v12);
v10 = 0;
goto LABEL_23;
}
v9 = sub_100604170((__int64)v8, 0);
if ( !v9 )
{
v14 = 13;
v15 = 224;
goto LABEL_19;
}
v10 = sub_1006037C4(*(_QWORD *)(a1 + 24), v9);
LABEL_16:
sub_1005F4000(v9);
LABEL_23:
if ( v8 )
goto LABEL_24;
return v10;
}