//
// dllmain_crt_dispatch from 0x180120a8c to 0x180120adc (80 bytes)
//
// 4 xrefs:
// > dllmain_dispatch @ 0x180120ce7
// > dllmain_dispatch @ 0x180120d59
// > dllmain_dispatch @ 0x180142b03
// > ??> @ 0x180202570
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:52 +0000
//
__int64 __fastcall dllmain_crt_dispatch(Concurrency::details::ScheduleGroupSegmentBase *a1, int a2, void *const a3)
{
int v3; // edx
int v4; // edx
__int64 result; // rax
if ( !a2 )
return dllmain_crt_process_detach(a3 != nullptr);
v3 = a2 - 1;
if ( !v3 )
return dllmain_crt_process_attach((HINSTANCE)a1, a3);
v4 = v3 - 1;
if ( v4 )
{
if ( v4 != 1 )
return 1;
LOBYTE(result) = _scrt_dllmain_crt_thread_detach();
}
else
{
LOBYTE(result) = sub_18012052C(a1);
}
return (unsigned __int8)result;
}