//
// ossl_statem_client_pre_work from 0x9b50fc to 0x9b5198 (156 bytes)
//
// 4 xrefs:
// > sub_9B3990 @ 0x9b3b2c
// > ??> @ 0x768ac
// > sub_9B3990 @ 0x9b3a90
// > ??> @ 0xd1d4c8
//
// 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:06:59 +0000
//
int __fastcall ossl_statem_client_pre_work(_DWORD *a1, int a2, int a3, int a4)
{
int v4; // r3
int v6; // r3
v4 = a1[16];
switch ( v4 )
{
case 12:
v6 = *(_DWORD *)(a1[1] + 100);
a1[10] = 0;
if ( (*(_DWORD *)(v6 + 52) & 8) == 0 || ssl3_init_finished_mac(a1) )
return 2;
ossl_statem_set_error((int)a1);
return 0;
case 16:
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) == 0 || !a1[30] )
return 2;
a1[21] = 0;
return 2;
case 1:
return tls_finish_handshake(a1, a2, a3, a4);
default:
return 2;
}
}