//
// sub_10071B050 from 0x10071b050 to 0x10071b28b (571 bytes)
//
// 0 xrefs:
//
// 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:36:10 +0000
//
std::string *__fastcall sub_10071B050(std::string *a1, __int64 *a2, int a3)
{
__int64 v4; // rbx
const char *v5; // r15
size_t v6; // rax
size_t v7; // r12
_BYTE *data; // r13
std::string *v9; // r14
size_t v10; // r14
__int64 v11; // rbx
const char *v12; // r12
size_t v13; // rax
std::string::size_type v14; // r13
char *v15; // r15
size_t v16; // r14
unsigned int v17; // edx
const std::string::value_type *v18; // rsi
std::string::size_type size; // rdx
std::string::value_type *__s; // [rsp+18h] [rbp-58h]
std::string __dst; // [rsp+20h] [rbp-50h] BYREF
std::string *v23; // [rsp+38h] [rbp-38h]
std::string::value_type __c[44]; // [rsp+44h] [rbp-2Ch]
std::string v25; // 0:^0.24
v4 = *a2;
if ( !*a2 )
{
v5 = "";
v6 = strlen("");
if ( v6 < 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_5;
LABEL_33:
sub_100003630();
}
v5 = "";
if ( *(_QWORD *)(v4 + 16) )
v5 = *(const char **)(v4 + 16);
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_33;
LABEL_5:
v7 = v6;
v23 = a1;
*(_DWORD *)__c = a3;
if ( v6 >= 0x17 )
{
v10 = 26;
if ( (v6 | 7) != 0x17 )
v10 = (v6 | 7) + 1;
data = operator new(v10);
a1->__r_.__value_.__r.__words[2] = (std::string::size_type)data;
a1->__r_.__value_.__r.__words[0] = v10 + 1;
a1->__r_.__value_.__l.__size_ = v7;
LABEL_12:
memmove(data, v5, v7);
data[v7] = 0;
v9 = v23;
if ( !v4 )
return v9;
goto LABEL_13;
}
a1->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v6);
data = a1->__r_.__value_.__s.__data_;
if ( v6 )
goto LABEL_12;
*data = 0;
v9 = v23;
if ( !v4 )
return v9;
LABEL_13:
v11 = *(_QWORD *)(v4 + 8);
if ( v11 )
{
__s = v9->__r_.__value_.__s.__data_;
*(_DWORD *)__c = __c[0];
do
{
v12 = *(const char **)(v11 + 16);
if ( !v12 )
v12 = "";
v13 = strlen(v12);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v14 = v13;
if ( v13 >= 0x17 )
{
v16 = (v13 | 7) + 1;
if ( (v13 | 7) == 0x17 )
v16 = 26;
v15 = (char *)operator new(v16);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v15;
__dst.__r_.__value_.__r.__words[0] = v16 | 1;
__dst.__r_.__value_.__l.__size_ = v14;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v13);
v15 = __dst.__r_.__value_.__s.__data_;
if ( !v13 )
goto LABEL_26;
}
memmove(v15, v12, v14);
LABEL_26:
v15[v14] = 0;
v9 = v23;
std::string::push_back(&__dst, __c[0]);
v17 = (unsigned int)v9->__r_.__value_.__l.0;
if ( (v17 & 1) != 0 )
{
v18 = v9->__r_.__value_.__l.__data_;
size = v9->__r_.__value_.__l.__size_;
}
else
{
size = v17 >> 1;
v18 = __s;
}
std::string::append(&__dst, v18, size);
v25 = *v9;
*v9 = __dst;
__dst = v25;
if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v11 = *(_QWORD *)(v11 + 8);
}
while ( v11 );
}
return v9;
}