//
// sub_60FD74 from 0x60fd74 to 0x60fece (346 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall sub_60FD74(int a1, char *a2, size_t a3, const char **a4, size_t *a5)
{
size_t v5; // r4
char *v7; // r6
const char *v9; // r0
const char *v10; // r5
unsigned int v11; // r7
const char *v12; // r0
int v13; // r3
char *v14; // lr
unsigned int v15; // r12
bool v16; // zf
int v17; // r11
unsigned int v18; // r7
const char *v19; // [sp+14h] [bp-8h]
v5 = a3;
v7 = a2;
*a4 = nullptr;
*a5 = 0;
if ( !a3 )
v5 = strlen(a2);
if ( v5 >= 0x40000000 )
return 27;
v9 = (const char *)off_ABAEAC(4 * v5 / 3 + 4);
v19 = v9;
if ( !v9 )
return 27;
if ( v5 )
{
v10 = v9;
while ( 1 )
{
v11 = (unsigned __int8)*v7;
v12 = v10;
v13 = v11 & 3;
v14 = &aAbcdefghijklmn_5[v11 >> 2];
if ( v5 == 1 )
{
sub_624640(
v10,
5,
"%c%c==",
(unsigned __int8)aAbcdefghijklmn_5[(v11 >> 2) + 72],
(unsigned __int8)aAbcdefghijklmn_5[16 * (v11 & 3) + 72]);
goto LABEL_13;
}
v15 = (unsigned __int8)v7[1];
v16 = v5 == 2;
v5 -= 3;
v17 = v15 & 0xF;
if ( v16 )
break;
v18 = (unsigned __int8)v7[2];
v10 += 4;
v7 += 3;
sub_624640(
v12,
5,
"%c%c%c%c",
(unsigned __int8)v14[72],
(unsigned __int8)aAbcdefghijklmn_5[((v15 >> 4) | (16 * v13)) + 72],
(unsigned __int8)aAbcdefghijklmn_5[((v18 >> 6) | (4 * v17)) + 72],
(unsigned __int8)aAbcdefghijklmn_5[(v18 & 0x3F) + 72]);
if ( !v5 )
goto LABEL_14;
}
sub_624640(
v10,
5,
"%c%c%c=",
(unsigned __int8)aAbcdefghijklmn_5[(v11 >> 2) + 72],
(unsigned __int8)aAbcdefghijklmn_5[((v15 >> 4) | (16 * (v11 & 3))) + 72],
(unsigned __int8)aAbcdefghijklmn_5[4 * v17 + 72]);
LABEL_13:
v10 += 4;
}
else
{
v10 = v9;
}
LABEL_14:
*v10 = 0;
*a4 = v19;
off_ABAEB0(nullptr);
*a5 = strlen(v19);
return 0;
}