//
// ERR_peek_last_error_line_data from 0xda10e0 to 0xda11cc (236 bytes)
//
// 1 xrefs:
// > ??> @ 0x7e1c8
//
// 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 ERR_peek_last_error_line_data(_QWORD *a1, _DWORD *a2, _QWORD *a3, _DWORD *a4)
{
__int64 state; // x0
int v6; // w4
__int64 v7; // x5
_QWORD *v8; // x0
__int64 v9; // x6
__int64 v10; // x8
__int64 v11; // x0
__int64 result; // x0
state = ERR_get_state();
v6 = *(_DWORD *)(state + 576);
v7 = state;
if ( *(_DWORD *)(state + 580) == v6 )
return 0;
v8 = (_QWORD *)(state + 8LL * v6);
v9 = v8[8];
if ( a1 && a2 )
{
v10 = v8[48];
if ( v10 )
{
*a1 = v10;
*a2 = *(_DWORD *)(v7 + 4 * (v6 + 128LL));
}
else
{
*a1 = "NA";
*a2 = 0;
}
}
if ( !a3 )
return v9;
v11 = v8[24];
if ( !v11 )
{
*a3 = &byte_F288A0;
if ( a4 )
{
*a4 = 0;
return v9;
}
return v9;
}
*a3 = v11;
if ( !a4 )
return v9;
result = v9;
*a4 = *(_DWORD *)(v7 + 4 * (v6 + 80LL));
return result;
}