//
// sub_100749338 from 0x100749338 to 0x10074963c (772 bytes)
//
// 1 xrefs:
// > sub_100749110 @ 0x1007491a0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 11:13:24 +0000
//
__int64 sub_100749338()
{
int v0; // w0
__int16 v1; // w2
int v2; // w4
char *v3; // x1
__int64 *v4; // x0
void *v5; // x19
void *v6; // x21
__int64 (__fastcall *v7)(const char *); // x20
__int64 (__fastcall *v8)(_QWORD); // x22
void *v9; // x23
void *v10; // x24
__int64 v11; // x25
__int64 v12; // x26
__int64 v13; // x27
__int64 v14; // x8
__int64 (__fastcall *v15)(_QWORD, _QWORD); // x0
__int64 v16; // x0
__int64 v17; // x19
__int64 v19; // [xsp+8h] [xbp-68h]
__int64 v20; // [xsp+10h] [xbp-60h]
__int64 v21; // [xsp+18h] [xbp-58h]
if ( qword_100A0F740 )
{
v0 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v0 = sub_100707AE4();
dword_100A0F724 = v0;
}
v1 = 100;
v2 = 406;
}
else
{
if ( qword_100A0F780 )
v3 = (char *)qword_100A0F780;
else
v3 = "ubsec";
v4 = sub_1006FC118(nullptr, v3, 0, 0);
qword_100A0F740 = (__int64)v4;
if ( v4 )
{
v5 = (void *)sub_1006FC348((__int64)v4, (__int64)"ubsec_bytes_to_bits");
if ( !v5 )
goto LABEL_27;
v6 = (void *)sub_1006FC348(qword_100A0F740, (__int64)"ubsec_bits_to_bytes");
if ( !v6 )
goto LABEL_27;
v7 = (__int64 (__fastcall *)(const char *))sub_1006FC348(qword_100A0F740, (__int64)"ubsec_open");
if ( !v7 )
goto LABEL_27;
v8 = (__int64 (__fastcall *)(_QWORD))sub_1006FC348(qword_100A0F740, (__int64)"ubsec_close");
if ( !v8 )
goto LABEL_27;
v9 = (void *)sub_1006FC348(qword_100A0F740, (__int64)"diffie_hellman_generate_ioctl");
if ( !v9 )
goto LABEL_27;
v10 = (void *)sub_1006FC348(qword_100A0F740, (__int64)"diffie_hellman_agree_ioctl");
if ( !v10 )
goto LABEL_27;
v11 = sub_1006FC348(qword_100A0F740, (__int64)"rsa_mod_exp_ioctl");
if ( !v11 )
goto LABEL_27;
v12 = sub_1006FC348(qword_100A0F740, (__int64)"rsa_mod_exp_crt_ioctl");
if ( v12
&& (v13 = sub_1006FC348(qword_100A0F740, (__int64)"dsa_sign_ioctl")) != 0
&& (v21 = sub_1006FC348(qword_100A0F740, (__int64)"dsa_verify_ioctl")) != 0
&& (v20 = sub_1006FC348(qword_100A0F740, (__int64)"math_accelerate_ioctl")) != 0
&& (v14 = sub_1006FC348(qword_100A0F740, (__int64)"rng_ioctl")) != 0
&& (v19 = v14,
(v15 = (__int64 (__fastcall *)(_QWORD, _QWORD))sub_1006FC348(
qword_100A0F740,
(__int64)"ubsec_max_key_len_ioctl")) != nullptr) )
{
off_100A0F750 = v5;
off_100A0F778 = v6;
*(_QWORD *)&xmmword_100A0F728 = v7;
off_100A0F738 = v8;
off_100A0F768 = v9;
off_100A0F770 = v10;
qword_100A0F748 = v11;
*((_QWORD *)&xmmword_100A0F728 + 1) = v12;
*(_QWORD *)&xmmword_100A0F758 = v13;
*((_QWORD *)&xmmword_100A0F758 + 1) = v21;
qword_100A0F788 = v20;
qword_100A0F790 = v19;
off_100A0F798 = v15;
v16 = v7("/dev/ubskey");
v17 = v16;
if ( (int)v16 >= 1 && !(unsigned int)off_100A0F798(v16, &dword_1009F1340) )
{
off_100A0F738(v17);
return 1;
}
v0 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v0 = sub_100707AE4();
dword_100A0F724 = v0;
}
v1 = 108;
v2 = 481;
}
else
{
LABEL_27:
v0 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v0 = sub_100707AE4();
dword_100A0F724 = v0;
}
v1 = 103;
v2 = 450;
}
}
else
{
v0 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v0 = sub_100707AE4();
dword_100A0F724 = v0;
}
v1 = 103;
v2 = 414;
}
}
sub_100706FB0(v0, 105, v1, (__int64)"e_ubsec.c", v2);
if ( qword_100A0F740 )
sub_1006FC01C((__int64 *)qword_100A0F740);
qword_100A0F740 = 0;
off_100A0F750 = nullptr;
off_100A0F778 = nullptr;
off_100A0F738 = nullptr;
off_100A0F768 = nullptr;
off_100A0F770 = nullptr;
qword_100A0F748 = 0;
xmmword_100A0F728 = 0u;
xmmword_100A0F758 = 0u;
off_100A0F798 = nullptr;
return 0;
}