int __fastcall gcp_cmdFE07_CreateAuthenticatedSession(struct gcp_ctx *ctx, struct ta_params *params) { int v4; // r7 struct gcp_auth_session *auth; // r6 unsigned int *p_asd_refcount; // r0 int v7; // r4 __int64 v8; // kr00_8 unsigned int v9; // r1 unsigned __int64 arg10; // kr08_8 unsigned int handle; // r0 int v12; // r0 v4 = 0; gcp_log(level: 0, fmt: aAmdTaGcpCreate); auth = ctx->auth; p_asd_refcount = &ctx->asd_refcount; while ( 1 ) { if ( v4 == 0x10000000 ) { v7 = 529; goto LABEL_10; } if ( *(_DWORD *)&auth->body[16] == 0 ) break; ++auth; v4 += 0x1000000; } *(_DWORD *)&auth->body[16] = 1; auth->state = params->arg18; v8 = *(_QWORD *)p_asd_refcount; v9 = ctx->unk1E04 + 1; arg10 = params->arg10; ++*p_asd_refcount; ctx->unk1E04 = v9; handle = HIDWORD(v8) & 0xFFFFFF | v4; *(_QWORD *)&auth->body[8] = arg10; auth->handle = handle; if ( (_DWORD)v8 == 0 ) { v12 = gcp_asd_rpc_305(arg: 1u); if ( v12 != 0 ) { v7 = v12 | 0x20000000; goto LABEL_10; } handle = auth->handle; } v7 = 0; params->out1950 = handle; gcp_log(level: 0, fmt: aAmdTaGcpCreate_0); LABEL_10: gcp_log(level: 0, fmt: (const char *)off_402F8C); return v7; }