//
// PlatformToolbox::spriteFromSavedFile from 0x39534c to 0x395552 (518 bytes)
//
// 0 xrefs:
//
// 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:46:19 +0000
//
int __fastcall PlatformToolbox::spriteFromSavedFile(unsigned __int8 *a1)
{
const char *v1; // r6
const char *v3; // r1
char v4; // r3
size_t v5; // r0
size_t i; // r3
unsigned __int8 *v7; // r6
unsigned int v8; // r1
unsigned __int8 *v9; // r5
int v10; // r0
unsigned __int8 *v11; // lr
char *v12; // r1
int v13; // r8
unsigned __int8 *v14; // r0
unsigned __int8 *v15; // r8
char *v16; // r3
int v17; // r9
unsigned __int8 *v18; // r12
char *v19; // r9
int v20; // t1
size_t v21; // r8
unsigned int v22; // r2
char *v23; // r3
size_t v24; // r1
int v25; // r3
unsigned int v26; // r1
char *v27; // r2
cocos2d::CCSprite *v28; // r0
int v29; // r0
int v30; // r2
const void *v31; // r1
size_t v32; // r2
const char *v33; // r1
cocos2d::CCSprite *v34; // r0
int v35; // r5
int v37; // [sp+10h] [bp-2Ch] BYREF
unsigned int v38; // [sp+14h] [bp-28h]
char *v39; // [sp+18h] [bp-24h]
int v40; // [sp+1Ch] [bp-20h] BYREF
unsigned int v41; // [sp+20h] [bp-1Ch]
unsigned __int8 *v42; // [sp+24h] [bp-18h]
int v43; // [sp+28h] [bp-14h] BYREF
size_t v44; // [sp+2Ch] [bp-10h]
cocos2d::CCSprite *v45; // [sp+30h] [bp-Ch]
if ( PlatformToolbox::isHD((PlatformToolbox *)a1) )
{
v4 = *a1;
v37 = 0;
v38 = 0;
if ( (v4 & 1) == 0 )
v1 = (const char *)(a1 + 1);
v39 = nullptr;
if ( (v4 & 1) != 0 )
v1 = *((const char **)a1 + 2);
v5 = strlen(v1);
std::string::__init(&v37, v1, v5);
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::__init(&v40, ".png", 4u);
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "-hd.png", 7u);
for ( i = 0; ; i = v25 + v21 )
{
if ( (v37 & 1) != 0 )
{
v7 = (unsigned __int8 *)v39;
v8 = v38;
}
else
{
v8 = (int)(unsigned __int8)v37 >> 1;
v7 = (unsigned __int8 *)&v37 + 1;
}
if ( (v40 & 1) != 0 )
{
v9 = v42;
v10 = v41;
}
else
{
v10 = (int)(unsigned __int8)v40 >> 1;
v9 = (unsigned __int8 *)&v40 + 1;
}
if ( i > v8 || v8 - i < v10 )
break;
if ( v10 )
{
v11 = &v7[i];
v12 = (char *)&v7[v8];
if ( v12 - (char *)&v7[i] >= v10 )
{
v13 = 1 - v10;
v14 = &v9[v10];
v15 = (unsigned __int8 *)&v12[v13];
LABEL_16:
while ( 1 )
{
v16 = (char *)v11;
if ( v11 == v15 )
break;
v17 = *v11++;
if ( v17 == *v9 )
{
v18 = v9;
v19 = v16;
while ( ++v18 != v14 )
{
v20 = (unsigned __int8)*++v19;
if ( v20 != *v18 )
goto LABEL_16;
}
goto LABEL_23;
}
}
}
v16 = v12;
LABEL_23:
if ( v16 == v12 )
break;
v21 = v16 - (char *)v7;
}
else
{
v21 = i;
}
if ( v21 == -1 )
break;
if ( (v40 & 1) != 0 )
v22 = v41;
else
v22 = (int)(unsigned __int8)v40 >> 1;
if ( (v43 & 1) != 0 )
{
v23 = (char *)v45;
v24 = v44;
}
else
{
v24 = (int)(unsigned __int8)v43 >> 1;
v23 = (char *)&v43 + 1;
}
std::string::replace(&v37, v21, v22, v23, v24);
if ( (v43 & 1) != 0 )
v25 = v44;
else
v25 = (int)(unsigned __int8)v43 >> 1;
}
std::string::~string((int)&v43);
std::string::~string((int)&v40);
if ( (*a1 & 1) != 0 )
{
**((_BYTE **)a1 + 2) = 0;
*((_DWORD *)a1 + 1) = 0;
}
else
{
a1[1] = 0;
*a1 = 0;
}
std::string::reserve((int *)a1, 0);
v26 = v38;
v27 = v39;
*(_DWORD *)a1 = v37;
*((_DWORD *)a1 + 1) = v26;
*((_DWORD *)a1 + 2) = v27;
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::~string((int)&v37);
}
if ( (*a1 & 1) != 0 )
v28 = *((cocos2d::CCSprite **)a1 + 2);
else
v28 = (cocos2d::CCSprite *)(a1 + 1);
v29 = cocos2d::CCSprite::create(v28, v3);
if ( v29 )
return v29;
v43 = 0;
v44 = 0;
v45 = nullptr;
std::string::__init(&v43, "/data/data/com.robtopx.geometryjump/", 0x24u);
v30 = *a1;
if ( (v30 & 1) != 0 )
{
v31 = *((const void **)a1 + 2);
v32 = *((_DWORD *)a1 + 1);
}
else
{
v31 = a1 + 1;
v32 = v30 >> 1;
}
std::string::append(&v43, v31, v32);
if ( (v43 & 1) != 0 )
v34 = v45;
else
v34 = (cocos2d::CCSprite *)((char *)&v43 + 1);
v35 = cocos2d::CCSprite::create(v34, v33);
std::string::~string((int)&v43);
return v35;
}