//
// sub_100427D10 from 0x100427d10 to 0x100427e81 (369 bytes)
//
// 5 xrefs:
// > sub_1004273E0 @ 0x10042748a
// > sub_1004273E0 @ 0x1004274e0
// > sub_1004273E0 @ 0x100427536
// > sub_1004273E0 @ 0x10042758c
// > sub_1004273E0 @ 0x1004275e2
//
// 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 12:30:18 +0000
//
bool __fastcall sub_100427D10(CURL *curl, __int64 a2)
{
int v2; // r15d
int v3; // r12d
_DWORD *v4; // r14
_DWORD *v5; // r14
if ( a2 )
{
v2 = *(_DWORD *)(a2 + 204);
v3 = *(_DWORD *)(a2 + 208);
if ( v3 <= 0 )
{
if ( qword_100BE3A00 )
{
v3 = *(_DWORD *)(qword_100BE3A00 + 64);
if ( v2 <= 0 )
goto LABEL_9;
}
else
{
v4 = operator new(0x48u);
cocos2d::extension::CCHttpClient::CCHttpClient(v4);
qword_100BE3A00 = (__int64)v4;
v3 = v4[16];
if ( v2 <= 0 )
{
LABEL_9:
v5 = (_DWORD *)qword_100BE3A00;
if ( !qword_100BE3A00 )
{
v5 = operator new(0x48u);
cocos2d::extension::CCHttpClient::CCHttpClient(v5);
qword_100BE3A00 = (__int64)v5;
}
v2 = v5[17];
}
}
}
else if ( v2 <= 0 )
{
goto LABEL_9;
}
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &unk_100BE3A10);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, (unsigned int)v3);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (unsigned int)v2);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 0);
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1);
curl_easy_setopt(curl, CURLOPT_DNS_CACHE_TIMEOUT, 60);
}
return a2 != 0;
}