//
// sub_811818 from 0x811818 to 0x8118a6 (142 bytes)
//
// 2 xrefs:
// > pugi::xml_document::load_file @ 0x81539e
// > pugi::xml_document::save_file @ 0x815608
//
// 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 12:01:37 +0000
//
FILE *__fastcall sub_811818(unsigned int *a1, int a2)
{
unsigned int *v4; // r3
unsigned int *v5; // r5
int v6; // r5
int v7; // r10
FILE *result; // r0
const char *v9; // r4
int v10; // r3
char *v11; // r1
char v12; // r2
int v13; // t1
FILE *v14; // r5
char v15; // [sp+0h] [bp-9h] BYREF
_DWORD v16[2]; // [sp+1h] [bp-8h] BYREF
v16[0] = a1;
v16[1] = a2;
v4 = a1;
do
v5 = v4++;
while ( *v5 );
v6 = v5 - a1;
v7 = sub_811418(a1, v6);
result = (FILE *)off_D2006C(v7 + 1);
v9 = (const char *)result;
if ( result )
{
sub_8109E4(a1, v6, result);
v10 = a2 - 4;
v11 = &v15;
v9[v7] = 0;
v16[0] = 0;
while ( 1 )
{
v13 = *(_DWORD *)(v10 + 4);
v10 += 4;
v12 = v13;
if ( !v13 )
break;
*++v11 = v12;
}
v14 = fopen(v9, (const char *)v16);
off_D20070(v9);
return v14;
}
return result;
}