//
// sub_100164270 from 0x100164270 to 0x1001643a0 (304 bytes)
//
// 2 xrefs:
// > DS_Dictionary::copyFile @ 0x10016130c
// > DS_Dictionary::copyFile @ 0x100161394
//
// 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
//
__int64 __fastcall sub_100164270(__int64 a1, char *__filename, int a3)
{
int v4; // w20
signed int v5; // w9
const char *v6; // x8
FILE *v7; // x1
if ( *(_QWORD *)(a1 + 120) )
return 0;
v4 = a1;
v5 = a3 & 0xFFFFFFFD;
v6 = "w";
if ( (int)(a3 & 0xFFFFFFFD) <= 47 )
{
switch ( v5 )
{
case 1:
case 17:
v6 = "a";
goto LABEL_21;
case 5:
case 21:
v6 = "ab";
goto LABEL_21;
case 8:
v6 = "r";
goto LABEL_21;
case 9:
case 25:
v6 = "a+";
goto LABEL_21;
case 12:
v6 = "rb";
goto LABEL_21;
case 13:
case 29:
v6 = "a+b";
goto LABEL_21;
case 16:
goto LABEL_21;
case 20:
goto LABEL_9;
case 24:
v6 = "r+";
goto LABEL_21;
case 28:
v6 = "r+b";
goto LABEL_21;
default:
return 0;
}
}
if ( v5 > 55 )
{
if ( v5 == 56 )
{
v6 = "w+";
goto LABEL_21;
}
if ( v5 == 60 )
{
v6 = "w+b";
goto LABEL_21;
}
return 0;
}
if ( v5 != 48 )
{
if ( v5 == 52 )
{
LABEL_9:
v6 = "wb";
goto LABEL_21;
}
return 0;
}
LABEL_21:
v7 = fopen(__filename, v6);
return sub_1001644F4(v4, v7);
}