//
// sub_1006028A4 from 0x1006028a4 to 0x100602980 (220 bytes)
//
// 1 xrefs:
// > sub_100602AFC @ 0x100602b5c
//
// 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
//
_DWORD **__fastcall sub_1006028A4(_DWORD ***a1, __int64 a2, int a3, char *a4)
{
_DWORD **v8; // x19
_QWORD *v9; // x0
if ( !a1 || (v8 = *a1) == nullptr )
{
v8 = (_DWORD **)sub_1005F331C();
if ( !v8 )
return nullptr;
}
if ( !a2 || !v8 )
{
sub_1005E0E48(11, 115, 67, (__int64)"x509name.c", 352);
goto LABEL_12;
}
sub_1005EE6D8(*v8);
v9 = sub_10058BE58(a2);
*v8 = v9;
if ( !v9 || !(unsigned int)sub_100602BE8((int)v8, a3, a4) )
{
LABEL_12:
if ( !a1 || v8 != *a1 )
sub_1005F3328((__int64)v8);
return nullptr;
}
if ( a1 && !*a1 )
*a1 = v8;
return v8;
}