int __fastcall gcp_cmdFE0C_CreateCryptoSession(struct gcp_ctx *ctx, struct ta_params *params) { int v4; // r7 struct gcp_crypto_session *crypto; // r5 unsigned int *p_asd_refcount; // r6 int v7; // r4 unsigned int v8; // r2 unsigned int v9; // r3 unsigned __int64 arg18; // kr00_8 unsigned int handle; // r0 int v12; // r0 v4 = 0; gcp_log(level: 0, fmt: aAmdTaGcpCreate_2); crypto = ctx->crypto; p_asd_refcount = &ctx->asd_refcount; while ( 1 ) { if ( v4 == 0x40000000 ) { v7 = 785; goto LABEL_10; } if ( crypto->state == 0 ) break; v4 += 0x1000000; ++crypto; } gcp_lib_zero_fill_words(dst: crypto, len: 0x58u); crypto->state = 1; crypto->key = params->arg10; v8 = *p_asd_refcount; v9 = p_asd_refcount[2]; arg18 = params->arg18; ++*p_asd_refcount; p_asd_refcount[2] = v9 + 1; handle = v9 & 0xFFFFFF | v4; crypto->field10 = arg18; crypto->handle = handle; if ( v8 == 0 ) { v12 = gcp_asd_rpc_305(arg: 1u); if ( v12 != 0 ) { v7 = v12 | 0x20000000; goto LABEL_10; } handle = crypto->handle; } params->out1950 = handle; v7 = 0; gcp_log(level: 0, fmt: aAmdTaGcpCreate_3); LABEL_10: gcp_log(level: 0, fmt: aAmdTaGcpCreate_4); return v7; }