//
// ossl_statem_client_write_transition from 0x7a0398 to 0x7a04f8 (352 bytes)
//
// 4 xrefs:
// > sub_79ED8C @ 0x79f048
// > ??> @ 0x5ce3c
// > sub_79ED8C @ 0x79ee90
// > ??> @ 0xab8508
//
// 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
//
int __fastcall ossl_statem_client_write_transition(_DWORD *a1)
{
int result; // r0
int *v2; // r2
int v3; // r3
int v4; // r2
int v5; // r3
switch ( a1[16] )
{
case 0:
case 1:
case 2:
a1[16] = 12;
return 1;
case 8:
if ( !*(_DWORD *)(a1[26] + 536) )
goto LABEL_11;
a1[16] = 13;
return 1;
case 0xB:
if ( !a1[30] )
goto LABEL_20;
goto LABEL_4;
case 0xC:
goto LABEL_6;
case 0xD:
LABEL_11:
a1[16] = 14;
return 1;
case 0xE:
v2 = (int *)a1[26];
v3 = v2[134];
v4 = *v2;
if ( v3 == 1 )
v5 = 15;
else
v5 = 16;
a1[16] = v5;
if ( (v4 & 0x10) != 0 )
goto LABEL_4;
return 1;
case 0xF:
LABEL_4:
a1[16] = 16;
return 1;
case 0x10:
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) != 0 || !*(_DWORD *)(a1[26] + 836) )
goto LABEL_9;
a1[16] = 17;
result = 1;
break;
case 0x11:
LABEL_9:
a1[16] = 18;
result = 1;
break;
case 0x12:
if ( a1[30] )
{
LABEL_20:
a1[16] = 1;
ossl_statem_set_in_init((int)a1, 0);
result = 1;
}
else
{
LABEL_6:
result = 2;
}
break;
default:
result = 0;
break;
}
return result;
}