//
// ossl_statem_client_write_transition from 0xd48a68 to 0xd48bc8 (352 bytes)
//
// 5 xrefs:
// > sub_D47644 @ 0xd478f8
// > sub_D47644 @ 0xd47d3c
// > ??> @ 0x8bd10
// > sub_D47644 @ 0xd4774c
// > ??> @ 0x122cc20
//
// 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 ossl_statem_client_write_transition(__int64 a1)
{
__int64 v1; // x1
unsigned int v2; // w2
__int64 *v4; // x0
__int64 v5; // x3
int v6; // w0
v1 = a1 + 72;
switch ( *(_DWORD *)(a1 + 92) )
{
case 0:
case 1:
case 2:
*(_DWORD *)(a1 + 92) = 12;
return 1;
case 8:
v2 = 1;
if ( !*(_DWORD *)(*(_QWORD *)(a1 + 144) + 568LL) )
goto LABEL_19;
*(_DWORD *)(a1 + 92) = 13;
return v2;
case 0xB:
if ( *(_DWORD *)(a1 + 176) )
goto LABEL_7;
goto LABEL_18;
case 0xC:
return 2;
case 0xD:
LABEL_19:
*(_DWORD *)(a1 + 92) = 14;
return 1;
case 0xE:
v4 = *(__int64 **)(a1 + 144);
v2 = 1;
v5 = *v4;
if ( *((_DWORD *)v4 + 142) == 1 )
v6 = 15;
else
v6 = 16;
*(_DWORD *)(v1 + 20) = v6;
if ( (v5 & 0x10) != 0 )
goto LABEL_7;
return v2;
case 0xF:
LABEL_7:
*(_DWORD *)(v1 + 20) = 16;
return 1;
case 0x10:
if ( (*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 104LL) & 8) != 0
|| !*(_DWORD *)(*(_QWORD *)(a1 + 144) + 968LL) )
{
goto LABEL_10;
}
v2 = 1;
*(_DWORD *)(a1 + 92) = 17;
return v2;
case 0x11:
LABEL_10:
*(_DWORD *)(a1 + 92) = 18;
return 1;
case 0x12:
v2 = 2;
if ( *(_DWORD *)(a1 + 176) )
{
LABEL_18:
*(_DWORD *)(a1 + 92) = 1;
ossl_statem_set_in_init(a1, 0);
return 1;
}
return v2;
default:
return 0;
}
}