//
// sub_6F29CC from 0x6f29cc to 0x6f2b6e (418 bytes)
//
// 3 xrefs:
// > EditorUI::pasteObjects @ 0x6f2da4
// > EditorUI::pasteObjects @ 0x6f2e62
// > EditorUI::pasteObjects @ 0x6f2f2c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:57:36 +0000
//
int __fastcall sub_6F29CC(unsigned __int8 *a1, char *a2, int *a3)
{
int v4; // r6
int v7; // r4
unsigned __int8 *v8; // r10
size_t v9; // r0
unsigned __int8 *v10; // r4
char *v11; // r0
unsigned __int8 *i; // r3
char *v13; // r2
int v14; // t1
int v15; // r4
int v16; // r6
unsigned int v17; // r11
int v18; // r3
size_t v19; // r2
unsigned int v20; // r3
std::logic_error *exception; // r4
unsigned __int8 *v22; // r1
size_t v23; // r3
unsigned __int8 *v24; // r1
int v25; // r3
int *v26; // r0
int v27; // r2
int v28; // r2
unsigned __int8 *v29; // r4
size_t v30; // r0
unsigned __int8 *v31; // r3
char *v32; // r0
char *v33; // r1
int v34; // t1
unsigned int v36; // [sp+4h] [bp-18h]
int v37; // [sp+8h] [bp-14h] BYREF
int v38; // [sp+Ch] [bp-10h]
int v39; // [sp+10h] [bp-Ch]
v4 = *a1;
if ( (v4 & 1) != 0 )
v7 = *((_DWORD *)a1 + 1);
else
v7 = v4 >> 1;
if ( (v4 & 1) != 0 )
v8 = *((unsigned __int8 **)a1 + 2);
else
v8 = a1 + 1;
v9 = strlen(a2);
if ( v7 && v9 )
{
v10 = &v8[v7];
v11 = &a2[v9];
for ( i = v8; i != v10; ++i )
{
v13 = a2;
while ( v13 != v11 )
{
v14 = (unsigned __int8)*v13++;
if ( *i == v14 )
{
v15 = i - v8;
goto LABEL_17;
}
}
}
}
v15 = -1;
LABEL_17:
if ( (v4 & 1) != 0 )
v16 = *((_DWORD *)a1 + 1);
else
v16 = v4 >> 1;
v17 = 0;
while ( 1 )
{
v18 = *a1;
v19 = v15 - v17;
v37 = 0;
v38 = 0;
v39 = 0;
if ( (v18 & 1) != 0 )
{
v20 = *((_DWORD *)a1 + 1);
if ( v17 > v20 )
goto LABEL_25;
v22 = *((unsigned __int8 **)a1 + 2);
}
else
{
v20 = v18 >> 1;
if ( v17 > v20 )
{
LABEL_25:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v22 = a1 + 1;
}
v23 = v20 - v17;
v24 = &v22[v17];
if ( v19 >= v23 )
v19 = v23;
std::string::__init(&v37, v24, v19);
if ( (v37 & 1) != 0 )
v25 = v38;
else
v25 = (int)(unsigned __int8)v37 >> 1;
if ( v25 || v17 != v16 )
{
v26 = (int *)a3[1];
if ( v26 == (int *)a3[2] )
{
std::vector::__push_back_slow_path(a3, (int)&v37);
}
else
{
if ( v26 )
std::string::basic_string(v26, (int)&v37);
a3[1] += 12;
}
}
if ( v15 == -1 )
return std::string::~string((int)&v37);
v27 = *a1;
v17 = v15 + 1;
if ( (v27 & 1) != 0 )
{
v28 = *((_DWORD *)a1 + 1);
v29 = *((unsigned __int8 **)a1 + 2);
}
else
{
v28 = v27 >> 1;
v29 = a1 + 1;
}
v36 = v28;
v30 = strlen(a2);
if ( v17 < v36 && v30 )
{
v31 = &v29[v17];
v32 = &a2[v30];
while ( v31 != &v29[v36] )
{
v33 = a2;
while ( v33 != v32 )
{
v34 = (unsigned __int8)*v33++;
if ( *v31 == v34 )
{
v15 = v31 - v29;
goto LABEL_53;
}
}
++v31;
}
}
v15 = -1;
LABEL_53:
std::string::~string((int)&v37);
}
}