//
// sub_C34F00 from 0xc34f00 to 0xc35000 (256 bytes)
//
// 5 xrefs:
// > sub_C3879C @ 0xc392b4
// > sub_C3879C @ 0xc39364
// > sub_C3879C @ 0xc39398
// > sub_C3879C @ 0xc39584
// > sub_C3879C @ 0xc3abb0
//
// 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_C34F00(__int64 a1, __int64 a2, _QWORD *a3)
{
int v4; // w0
unsigned int v6; // w1
__int64 v7; // x20
unsigned int v8; // w19
unsigned int v10; // [xsp+3Ch] [xbp+3Ch] BYREF
v4 = *(_DWORD *)(a1 + 16);
if ( (v4 & 0x80000) != 0 )
{
*a3 = *(_QWORD *)(a2 + 16);
goto LABEL_8;
}
v6 = *(_DWORD *)(a2 + 16);
v10 = v6;
if ( (v4 & 0x80) != 0 )
{
TIFFSwabLong(&v10);
v7 = v10;
if ( (*(_DWORD *)(a1 + 16) & 0x800) != 0 )
goto LABEL_4;
LABEL_10:
if ( v7 != (*(__int64 (__fastcall **)(_QWORD, __int64, _QWORD))(a1 + 976))(*(_QWORD *)(a1 + 952), v7, 0)
|| (*(__int64 (__fastcall **)(_QWORD, _QWORD *, __int64))(a1 + 960))(*(_QWORD *)(a1 + 952), a3, 8) != 8 )
{
return 3;
}
v4 = *(_DWORD *)(a1 + 16);
goto LABEL_8;
}
v7 = v6;
if ( (v4 & 0x800) == 0 )
goto LABEL_10;
LABEL_4:
if ( (unsigned __int64)(v7 + 8) > *(_QWORD *)(a1 + 928) )
return 3;
TIFFmemcpy(a3, (const void *)(*(_QWORD *)(a1 + 920) + v7), 8u);
v4 = *(_DWORD *)(a1 + 16);
LABEL_8:
v8 = 0;
if ( (v4 & 0x80) == 0 )
return v8;
TIFFSwabLong8(a3);
return 0;
}