//
// __crt_seh_guarded_call::operator from 0x18013a0ec to 0x18013a2a6 (442 bytes)
//
// 2 xrefs:
// > setmbcp_internal @ 0x18013a739
// > ??> @ 0x180203830
//
// 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:55:02 +0000
//
void __fastcall __crt_seh_guarded_call::operator()<_lambda_efdfa57d1f175319df784efa44bb7b81_,_lambda_5f0a4c1567f8adc6734073e5d1e1b35c_ &,_lambda_2e8a7d3640ea6ccb4c2413664c2db6fd_>(
__int64 a1,
int *a2,
volatile signed __int32 ****a3,
int *a4)
{
_OWORD *v6; // rax
_OWORD *v7; // rcx
__int64 v8; // r8
__int64 v9; // r9
_OWORD *v10; // rax
_OWORD *v11; // rcx
void **v12; // rcx
sub_1801346AC(*a2);
v6 = (**a3)[17] + 6;
v7 = qword_1801F55C0;
if ( !qword_1801F55C0 )
goto LABEL_7;
if ( (**a3)[17] == (volatile signed __int32 *)-24LL )
{
memset(qword_1801F55C0, 0, 0x101u);
LABEL_7:
*errno() = 22;
invalid_parameter_noinfo();
v8 = 2;
goto LABEL_8;
}
v8 = 2;
v9 = 2;
do
{
*v7 = *v6;
v7[1] = v6[1];
v7[2] = v6[2];
v7[3] = v6[3];
v7[4] = v6[4];
v7[5] = v6[5];
v7[6] = v6[6];
v7 += 8;
*(v7 - 1) = v6[7];
v6 += 8;
--v9;
}
while ( v9 );
*(_BYTE *)v7 = *(_BYTE *)v6;
LABEL_8:
v10 = (_OWORD *)((char *)(**a3)[17] + 281);
v11 = qword_1801F55C8;
if ( !qword_1801F55C8 )
{
LABEL_13:
*errno() = 22;
invalid_parameter_noinfo();
goto LABEL_14;
}
if ( (**a3)[17] == (volatile signed __int32 *)-281LL )
{
memset(qword_1801F55C8, 0, 0x100u);
goto LABEL_13;
}
do
{
*v11 = *v10;
v11[1] = v10[1];
v11[2] = v10[2];
v11[3] = v10[3];
v11[4] = v10[4];
v11[5] = v10[5];
v11[6] = v10[6];
v11 += 8;
*(v11 - 1) = v10[7];
v10 += 8;
--v8;
}
while ( v8 );
LABEL_14:
if ( _InterlockedExchangeAdd(**a3[1], 0xFFFFFFFF) == 1 )
{
v12 = (void **)*a3[1];
if ( *v12 != &unk_1801B1A50 )
free_base(*v12);
}
**a3[1] = (**a3)[17];
_InterlockedIncrement((**a3)[17]);
sub_180134700(*a4);
}