//
// sub_100613058 from 0x100613058 to 0x10061313c (228 bytes)
//
// 1 xrefs:
// > sub_100582F38 @ 0x100582f54
//
// 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_100613058(void *a1, char *a2, char a3)
{
__int64 v6; // x19
void *v7; // x21
__int64 v8; // x22
v6 = sub_100611654(0);
if ( v6 )
{
v7 = a1;
if ( !a1 )
{
v7 = (void *)sub_10061313C();
if ( !v7 )
{
v8 = 0;
v7 = nullptr;
LABEL_14:
sub_100588C44(v7);
goto LABEL_15;
}
}
if ( (int)sub_1006116AC(v6) <= 0 )
{
if ( (a3 & 0x10) != 0 )
{
if ( (sub_1005E146C() & 0xFFF) == 0x72 )
{
sub_1005E1158();
v8 = 1;
}
else
{
v8 = 0;
}
}
else
{
v8 = 0;
}
}
else
{
v8 = sub_100612B84(v6, a2, a3);
}
}
else
{
v7 = nullptr;
v8 = 0;
}
if ( !a1 )
goto LABEL_14;
LABEL_15:
sub_100611698(v6);
return v8;
}