//
// sub_100907740 from 0x100907740 to 0x100907b3e (1022 bytes)
//
// 3 xrefs:
// > InfoLayer::onLevelInfo @ 0x100894f40
// > sub_1008F3500 @ 0x1008f3511
// > sub_1008F65D0 @ 0x1008f65e1
//
// 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:38:05 +0000
//
void __fastcall sub_100907740(__int64 a1)
{
char v1; // al
unsigned __int64 v2; // rdx
unsigned int v3; // edx
const std::string::value_type *data; // rsi
std::string::size_type size; // rdx
const std::string::value_type *v6; // rsi
std::string::size_type v7; // rdx
const std::string::value_type *v8; // rsi
const std::string::value_type *v9; // rsi
std::string::size_type v10; // rdx
int v11; // eax
const std::string::value_type *v12; // rsi
std::string::size_type v13; // rdx
const char *v14; // rbx
size_t v15; // rax
size_t v16; // r14
char *v17; // r15
size_t v18; // r12
char *v19; // rbx
_QWORD __dst[2]; // [rsp+0h] [rbp-90h] BYREF
void *v21; // [rsp+10h] [rbp-80h]
std::string v22; // [rsp+18h] [rbp-78h] BYREF
std::string v23; // [rsp+30h] [rbp-60h] BYREF
std::string __s[2]; // [rsp+50h] [rbp-40h] BYREF
memset(&v23, 0, sizeof(v23));
v1 = *(_BYTE *)(a1 + 400);
if ( (v1 & 1) == 0 )
{
if ( v1 )
{
__s[0] = *(std::string *)(a1 + 400);
goto LABEL_6;
}
LABEL_12:
*(_WORD *)&v22.__r_.__value_.__l.0 = 0;
goto LABEL_16;
}
v2 = *(_QWORD *)(a1 + 408);
if ( !v2 )
goto LABEL_12;
sub_10001AD30(__s, *(const void **)(a1 + 416), v2);
LABEL_6:
LevelTools::base64DecodeString(&v22, __s);
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__s[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) == 0 )
{
if ( v22.__r_.__value_.__s.0 )
{
__s[0] = v22;
v3 = (unsigned int)v22.__r_.__value_.__l.0;
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_17;
LABEL_15:
data = __s[0].__r_.__value_.__l.__data_;
size = __s[0].__r_.__value_.__l.__size_;
goto LABEL_18;
}
goto LABEL_16;
}
if ( !v22.__r_.__value_.__l.__size_ )
{
LABEL_16:
__s[0].__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
__s[0].__r_.__value_.__r.__words[0] = 33;
__s[0].__r_.__value_.__l.__size_ = 25;
strcpy(__s[0].__r_.__value_.__l.__data_, "(No description provided)");
v3 = (unsigned int)__s[0].__r_.__value_.__l.0;
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_15;
goto LABEL_17;
}
sub_10001AD30(__s, v22.__r_.__value_.__l.__data_, v22.__r_.__value_.__l.__size_);
v3 = (unsigned int)__s[0].__r_.__value_.__l.0;
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_15;
LABEL_17:
size = v3 >> 1;
data = __s[0].__r_.__value_.__s.__data_;
LABEL_18:
std::string::append(&v23, data, size);
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__s[0].__r_.__value_.__l.__data_);
if ( *(int *)(a1 + 316) > 0 || *(int *)(a1 + 364) > 0 )
{
std::string::append(&v23, "\n\n");
if ( *(int *)(a1 + 316) > 0 )
{
std::string::append(&v23, "Pack ID: ");
GameToolbox::intToString((size_t *)__s, *(_DWORD *)(a1 + 316));
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
{
v6 = __s[0].__r_.__value_.__l.__data_;
v7 = __s[0].__r_.__value_.__l.__size_;
}
else
{
v7 = *(_BYTE *)&__s[0].__r_.__value_.__l.0 >> 1;
v6 = __s[0].__r_.__value_.__s.__data_;
}
std::string::append(&v23, v6, v7);
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__s[0].__r_.__value_.__l.__data_);
std::string::append(&v23, "\n");
}
if ( (unsigned int)(*(_DWORD *)(a1 + 360) - 3) <= 1 )
{
std::string::append(&v23, "Visibility: ");
v8 = "Unlisted";
if ( *(_DWORD *)(a1 + 360) == 3 )
v8 = "Friends Only";
std::string::append(&v23, v8);
std::string::append(&v23, "\n");
}
if ( *(int *)(a1 + 364) > 0 )
{
std::string::append(&v23, "Uploaded: ");
GameToolbox::timestampToHumanReadable((char *)__s, *(int *)(a1 + 364));
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
{
v9 = __s[0].__r_.__value_.__l.__data_;
v10 = __s[0].__r_.__value_.__l.__size_;
}
else
{
v10 = *(_BYTE *)&__s[0].__r_.__value_.__l.0 >> 1;
v9 = __s[0].__r_.__value_.__s.__data_;
}
std::string::append(&v23, v9, v10);
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__s[0].__r_.__value_.__l.__data_);
std::string::append(&v23, "");
v11 = *(_DWORD *)(a1 + 368);
if ( v11 > 0 && *(_DWORD *)(a1 + 364) != v11 )
{
std::string::append(&v23, "\nUpdated: ");
GameToolbox::timestampToHumanReadable((char *)__s, *(int *)(a1 + 368));
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
{
v12 = __s[0].__r_.__value_.__l.__data_;
v13 = __s[0].__r_.__value_.__l.__size_;
}
else
{
v13 = *(_BYTE *)&__s[0].__r_.__value_.__l.0 >> 1;
v12 = __s[0].__r_.__value_.__s.__data_;
}
std::string::append(&v23, v12, v13);
if ( (*(_BYTE *)&__s[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__s[0].__r_.__value_.__l.__data_);
std::string::append(&v23, "");
}
}
}
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
v14 = v23.__r_.__value_.__l.__data_;
else
v14 = v23.__r_.__value_.__s.__data_;
v15 = strlen(v14);
if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v16 = v15;
if ( v15 >= 0x17 )
{
v18 = 26;
if ( (v15 | 7) != 0x17 )
v18 = (v15 | 7) + 1;
v17 = (char *)operator new(v18);
v21 = v17;
__dst[0] = v18 | 1;
__dst[1] = v16;
goto LABEL_57;
}
LOBYTE(__dst[0]) = 2 * v15;
v17 = (char *)__dst + 1;
if ( v15 )
LABEL_57:
memmove(v17, v14, v16);
v17[v16] = 0;
v19 = FLAlertLayer::create_1(0, (int)"Sound Pack Info", (__int64)__dst, (int)"OK", 0, 380.0);
if ( (__dst[0] & 1) != 0 )
operator delete(v21);
(*(void (__fastcall **)(char *))(*(_QWORD *)v19 + 1312LL))(v19);
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v22.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
}