//
// sub_1006117F8 from 0x1006117f8 to 0x1006118d0 (216 bytes)
//
// 3 xrefs:
// > sub_100611410 @ 0x100611430
// > sub_1006114B0 @ 0x1006114e8
// > sub_1006126D8 @ 0x1006129b8
//
// 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
//
char *__fastcall sub_1006117F8(__int64 a1, const char *a2, char *a3)
{
__int64 *v5; // x20
__int64 v6; // x0
char *result; // x0
const char *v8; // [xsp+28h] [xbp-38h] BYREF
char *v9; // [xsp+30h] [xbp-30h]
if ( !a3 )
return nullptr;
if ( !a1 )
return getenv(a3);
if ( !a2 )
{
v5 = (__int64 *)(a1 + 16);
LABEL_11:
v8 = "default";
v9 = a3;
v6 = sub_1005DF1B8(*v5, (__int64)&v8);
if ( v6 )
return *(char **)(v6 + 16);
return nullptr;
}
v8 = a2;
v9 = a3;
v5 = (__int64 *)(a1 + 16);
v6 = sub_1005DF1B8(*(_QWORD *)(a1 + 16), (__int64)&v8);
if ( v6 )
return *(char **)(v6 + 16);
if ( strcmp(a2, "ENV") )
goto LABEL_11;
result = getenv(a3);
if ( !result )
goto LABEL_11;
return result;
}