PB RepeatedField::erase

本文介绍了一种在遍历过程中删除元素的技巧,通过使用迭代器的erase方法,避免了手动递增迭代器的复杂性。

一 官网说明

二 使用

auto iter = users->begin();
for (; iter != users->end();) {
  if (s.find(iter->uid()) == s.end()) {
    iter = users->erase(iter); // iter不递增,利用erase的返回值
  } else {
    ++iter;
  }
}

请仔细阅读和分析下面函数,保持函数原始逻辑功能不变, 不要遗漏逻辑细节,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持原始函数定义不变,不要拆分函数 2.保持所有原始逻辑功能不变 3.结构体采用32位定义 4.严格保持protobuf字段映射关系,不要遗漏protobuf字段内容 5.提高执行效率,降低计算复杂度 6.已经给定的结构体名字和元素不要更改,详细的中文注释 7.自动添加中文注释说明功能逻辑 8.不使用 auto,使用显式 for 循环 特别注意: 1.函数中有关位操作不变,函数间的位操作一致 2.函数中的 HDDMXng::BelDef::BelDef 映射为 message BelDef { optional bool optinv = 1; optional bool rbel = 2; optional string belname = 3; optional uint32 numoutputpins = 4; optional uint32 numinputpins = 5; optional uint32 numpins = 6; optional uint32 numsrcs = 7; optional uint32 numprims = 8; repeated uint32 srcgnds = 9 [packed = true]; repeated BelDefPip pips = 10; optional bool hasusagedef = 11; } 其中,依赖消息有: message BelDefPip { optional uint32 pin1 = 1; optional uint32 pin2 = 2; repeated AttrSetting attrsettings = 3; } message AttrSetting { optional string attrname = 1; optional string attrvalue = 2; } 3.采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 进行编程 4.将函数中 _BYTE beldef_msg[16] 映射为 HDDMXng::BelDef beldef_msg void __fastcall HDDMBelDef::readme_pb(HDDMBelDef *this, std::istream *stream, HDDMDevice *hddmDevice) { google::protobuf::Message *v3; // rdx std::string **p_belDef_name; // rbx char v5; // al bool v6; // zf unsigned __int16 v7; // r14 _QWORD *v8; // rax __int64 v9; // rbx HDDMBelPinDef *hddmBelPinDefArray; // r12 HDDMBelPinDef *v11; // rbp __int64 v12; // rbx HDDMBelPinDef *v13; // r12 int v14; // r13d unsigned __int16 v15; // ax int v16; // ebx int v17; // ebp __int64 v18; // rax __int64 qword20; // r12 __int64 v20; // r13 __int64 v21; // rbx __int64 v22; // rax __int64 v23; // r12 int v24; // ebp unsigned __int64 v25; // rbx _QWORD *v26; // r13 _QWORD *v27; // rax int v28; // ebp __int64 qword48; // rdx _QWORD *v30; // rbx __int64 insert_hint_unique_pos; // rax __int64 v32; // rdx __int64 v33; // rdi unsigned __int64 v34; // rbx __int64 v35; // rbp __int64 v36; // rdi __int64 v37; // rdi __int64 v38; // rax const std::string *v39; // rbp unsigned __int16 v40; // ax __int64 v41; // rbx unsigned __int64 v42; // rbp char *v43; // rax unsigned __int64 v44; // rbx const char *v45; // rcx HDDMPrimitive *v46; // rbp void (__fastcall **vtable)(HDDMPrimitive *, std::istream *, HDDMDevice *); // rax HDDMPrimitive *hddmPrimitive; // rax int v49; // eax int v50; // eax std::string *belDef_name; // rax std::string *v52; // rsi std::string *v53; // rdx const char *v54; // rcx std::string *v55; // rax char v56; // di std::string *v57; // rdx char *v58; // rcx std::string *v59; // rax char v60; // di int v61; // edx int v62; // edx __int64 v64; // [rsp+8h] [rbp-140h] int v65; // [rsp+14h] [rbp-134h] int v66; // [rsp+18h] [rbp-130h] _QWORD *v67; // [rsp+18h] [rbp-130h] _QWORD *p_char40; // [rsp+30h] [rbp-118h] _QWORD *v71; // [rsp+38h] [rbp-110h] char v72; // [rsp+5Fh] [rbp-E9h] BYREF char v73[8]; // [rsp+60h] [rbp-E8h] BYREF __int64 v74; // [rsp+68h] [rbp-E0h] BYREF _BYTE v75[16]; // [rsp+70h] [rbp-D8h] BYREF std::string *v76; // [rsp+80h] [rbp-C8h] __int16 v77; // [rsp+88h] [rbp-C0h] char v78; // [rsp+8Ch] [rbp-BCh] char v79; // [rsp+8Dh] [rbp-BBh] char v80; // [rsp+8Eh] [rbp-BAh] __int16 v81; // [rsp+90h] [rbp-B8h] __int16 v82; // [rsp+94h] [rbp-B4h] int v83; // [rsp+9Ch] [rbp-ACh] __int64 v84; // [rsp+C8h] [rbp-80h] int v85; // [rsp+D0h] [rbp-78h] char v86; // [rsp+104h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 6LL); HDDMXng::BelDef::BelDef((HDDMXng::BelDef *)v75); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)v75, v3); p_belDef_name = &this->belDef_name; v5 = (16 * (v78 & 1)) | HIBYTE(this->beldef_code) & 0xEF; HIBYTE(this->beldef_code) = v5; HIBYTE(this->beldef_code) = (32 * (v79 & 1)) | v5 & 0xDF; std::string::assign((std::string *)&this->belDef_name, v76); if ( (this->beldef_code & 0x30000000) != 0 ) goto LABEL_4; if ( (unsigned __int8)sub_21655B0(p_belDef_name, "IDDR") || (unsigned __int8)sub_21655B0(p_belDef_name, "IPFF") || (unsigned __int8)sub_21655B0(p_belDef_name, "OPFF") ) { goto LABEL_67; } belDef_name = this->belDef_name; v52 = (std::string *)((char *)belDef_name + *((_QWORD *)belDef_name - 3)); if ( belDef_name == v52 ) goto LABEL_4; if ( *(_BYTE *)belDef_name == 79 ) { v53 = (std::string *)((char *)belDef_name + 1); v54 = "OPTFF"; v55 = (std::string *)((char *)belDef_name + 5); while ( 1 ) { ++v54; if ( v53 == v52 ) break; if ( v53 == v55 ) goto LABEL_67; v56 = *(_BYTE *)v53; v53 = (std::string *)((char *)v53 + 1); if ( v56 != *v54 ) goto LABEL_4; } if ( v54 != "" ) goto LABEL_4; LABEL_67: HIBYTE(this->beldef_code) |= 0x10u; goto LABEL_4; } if ( *(_BYTE *)belDef_name == 84 ) { v57 = (std::string *)((char *)belDef_name + 1); v58 = "TFF"; v59 = (std::string *)((char *)belDef_name + 3); while ( 1 ) { ++v58; if ( v57 == v52 ) break; if ( v57 == v59 ) goto LABEL_67; v60 = *(_BYTE *)v57; v57 = (std::string *)((char *)v57 + 1); if ( v60 != *v58 ) goto LABEL_4; } if ( v58 == "" ) goto LABEL_67; } LABEL_4: this->beldef_code = ((v81 & 0x3FFF) << 14) | this->beldef_code & 0xF0003FFF; this->beldef_code1 = (16 * (v77 & 0x3FFF)) | this->beldef_code1 & 0xFFFC000F; v6 = HDDMDeviceDump::useXngMarks == 0; LOWORD(this->beldef_code) = v82 & 0x3FFF | this->beldef_code & 0xC000; if ( !v6 ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 4LL); v7 = this->beldef_code & 0x3FFF; if ( v7 ) { v8 = (_QWORD *)operator new[](16LL * v7 + 8); v9 = v7 - 1LL; hddmBelPinDefArray = (HDDMBelPinDef *)(v8 + 1); *v8 = v7; v11 = (HDDMBelPinDef *)(v8 + 1); do { HDDMBelPinDef::HDDMBelPinDef(v11); --v9; ++v11; } while ( v9 != -1 ); v12 = 0LL; v6 = (this->beldef_code & 0x3FFF) == 0; this->hddmBelPinDefArray = hddmBelPinDefArray; if ( !v6 ) { while ( 1 ) { v13 = &hddmBelPinDefArray[v12]; HDDMBelPinDef::readme_pb(v13, stream, hddmDevice); LOWORD(v13->pindef_code1) = (16 * (HIWORD(this->beldef_code1) >> 2)) | v13->pindef_code1 & 0xF; v13->pindef_code = ((v12++ & 0x3FFF) << 6) | v13->pindef_code & 0xFFF0003F; if ( (this->beldef_code & 0x3FFF) <= (int)v12 ) break; hddmBelPinDefArray = this->hddmBelPinDefArray; } } HDDMBelDef::createpindefsmap(this); } if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 5LL); if ( v86 < 0 ) { v14 = v83; if ( v83 ) { v41 = operator new(0x18uLL); *(_QWORD *)v41 = 0LL; *(_QWORD *)(v41 + 8) = 0LL; *(_QWORD *)(v41 + 16) = 0LL; if ( (unsigned __int64)v14 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v42 = 8LL * v14; v43 = (char *)operator new(v42); *(_QWORD *)v41 = v43; *(_QWORD *)(v41 + 8) = v43; *(_QWORD *)(v41 + 16) = &v43[v42]; memset(v43, 0, v42); *(_QWORD *)(v41 + 8) = *(_QWORD *)(v41 + 16); this->hddmPrimitive = (HDDMPrimitive *)v41; if ( v14 > 0 ) { v44 = 0LL; do { std::istream::read(stream, v73, 2LL); HDDMDeviceDump::dumpbinary((HDDMDeviceDump *)v73, (const char *)&dword_0 + 2, (int)"beldef:", v45); v46 = HDDMPrimitive::create(*(unsigned __int16 *)v73); vtable = (void (__fastcall **)(HDDMPrimitive *, std::istream *, HDDMDevice *))v46->vtable; v46->hddmBelDef = this; (*vtable)(v46, stream, hddmDevice); hddmPrimitive = this->hddmPrimitive; if ( v44 >= (__int64)(*(_QWORD *)&hddmPrimitive->numPrimType - hddmPrimitive->vtable) >> 3 ) std::__throw_out_of_range("vector::_M_range_check"); *(_QWORD *)(hddmPrimitive->vtable + 8 * v44++) = v46; } while ( v14 > (int)v44 ); } } } if ( v85 ) { v15 = (this->beldef_code & 0x3FFF) - (((this->beldef_code >> 14) & 0x3FFF) + ((this->beldef_code1 >> 4) & 0x3FFF)); v16 = ((this->beldef_code >> 14) & 0x3FFF) + v15; v17 = v15 + ((this->beldef_code1 >> 4) & 0x3FFF); v18 = operator new[](8LL * v16); this->pipsMatrixVec = v18; if ( v16 ) { qword20 = v18; v20 = 8LL * (unsigned int)(v16 - 1) + 8; v21 = 0LL; while ( 1 ) { *(_QWORD *)(v21 + qword20) = operator new[](v17); v22 = 0LL; if ( v17 ) { do *(_BYTE *)(*(_QWORD *)(this->pipsMatrixVec + v21) + v22++) = 0; while ( v17 > (int)v22 ); } v21 += 8LL; if ( v21 == v20 ) break; qword20 = this->pipsMatrixVec; } } if ( v85 > 0 ) { v64 = 0LL; v65 = 0; p_char40 = &this->char40; do { v23 = *(_QWORD *)(v84 + v64); v24 = *(_DWORD *)(v23 + 20); v66 = *(_DWORD *)(v23 + 16); *(_BYTE *)(*(_QWORD *)(this->pipsMatrixVec + 8LL * v66) + v24) = 1; v25 = *(int *)(v23 + 32); if ( (_DWORD)v25 ) { v26 = (_QWORD *)operator new(0x18uLL); *v26 = 0LL; v26[1] = 0LL; v26[2] = 0LL; if ( v25 > 0xFFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v27 = (_QWORD *)operator new(16 * v25); *v26 = v27; v26[1] = v27; v26[2] = &v27[2 * v25]; do { if ( v27 ) { *v27 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; v27[1] = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; } v27 += 2; --v25; } while ( v25 ); v26[1] = v26[2]; v28 = ((this->beldef_code >> 14) & 0x3FFF) + (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code1 >> 4) & 0x3FFF) + ((this->beldef_code >> 14) & 0x3FFF))) + v24; qword48 = this->qword48; v30 = &this->char40; if ( !qword48 ) goto LABEL_45; do { while ( (unsigned __int16)v66 <= *(_WORD *)(qword48 + 32) && ((unsigned __int16)v66 < *(_WORD *)(qword48 + 32) || (unsigned __int16)v28 <= *(_WORD *)(qword48 + 34)) ) { v30 = (_QWORD *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_41; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_41: if ( p_char40 == v30 || (unsigned __int16)v66 < *((_WORD *)v30 + 16) || (unsigned __int16)v66 <= *((_WORD *)v30 + 16) && (unsigned __int16)v28 < *((_WORD *)v30 + 17) ) { LABEL_45: v71 = v30; v30 = (_QWORD *)operator new(0x30uLL); if ( v30 ) { *(_DWORD *)v30 = 0; v30[1] = 0LL; v30[2] = 0LL; v30[3] = 0LL; *((_WORD *)v30 + 17) = v28; v30[5] = 0LL; *((_WORD *)v30 + 16) = v66; } insert_hint_unique_pos = std::_Rb_tree<std::pair<unsigned short,unsigned short>,std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>,std::_Select1st<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>,std::less<std::pair<unsigned short,unsigned short>>,std::allocator<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>>::_M_get_insert_hint_unique_pos( &this->field_38, v71, v30 + 4); if ( v32 ) { v33 = 1LL; if ( !insert_hint_unique_pos && p_char40 != (_QWORD *)v32 ) { v40 = *(_WORD *)(v32 + 32); if ( *((_WORD *)v30 + 16) >= v40 && (*((_WORD *)v30 + 16) > v40 || *((_WORD *)v30 + 17) >= *(_WORD *)(v32 + 34)) ) { v33 = 0LL; } } std::_Rb_tree_insert_and_rebalance(v33, v30, v32, p_char40); ++this->qword60; } else { v67 = (_QWORD *)insert_hint_unique_pos; operator delete(v30); v30 = v67; } } v30[5] = v26; if ( *(int *)(v23 + 32) > 0 ) { v34 = 0LL; do { v38 = *(_QWORD *)(*(_QWORD *)(v23 + 24) + 8 * v34); v39 = *(const std::string **)(v38 + 24); std::string::string((std::string *)v73, *(const std::string **)(v38 + 16)); std::string::string((std::string *)&v74, v39); if ( v34 >= (__int64)(v26[1] - *v26) >> 4 ) std::__throw_out_of_range("vector::_M_range_check"); v35 = *v26 + 16 * v34; std::string::swap((std::string *)v35, (std::string *)v73); std::string::swap((std::string *)(v35 + 8), (std::string *)&v74); v36 = v74 - 24; if ( (_UNKNOWN *)(v74 - 24) != &std::string::_Rep::_S_empty_rep_storage ) { if ( &_pthread_key_create ) { v50 = _InterlockedExchangeAdd((volatile signed __int32 *)(v36 + 16), 0xFFFFFFFF); } else { v61 = *(_DWORD *)(v74 - 8); *(_DWORD *)(v74 - 8) = v61 - 1; v50 = v61; } if ( v50 <= 0 ) std::string::_Rep::_M_destroy(v36, &v72); } v37 = *(_QWORD *)v73 - 24LL; if ( (_UNKNOWN *)(*(_QWORD *)v73 - 24LL) != &std::string::_Rep::_S_empty_rep_storage ) { if ( &_pthread_key_create ) { v49 = _InterlockedExchangeAdd((volatile signed __int32 *)(v37 + 16), 0xFFFFFFFF); } else { v62 = *(_DWORD *)(*(_QWORD *)v73 - 8LL); *(_DWORD *)(*(_QWORD *)v73 - 8LL) = v62 - 1; v49 = v62; } if ( v49 <= 0 ) std::string::_Rep::_M_destroy(v37, &v72); } ++v34; } while ( *(_DWORD *)(v23 + 32) > (int)v34 ); } } ++v65; v64 += 8LL; } while ( v65 < v85 ); } } if ( v80 ) { HDDMBelDef::addusagedef(this); HDDMBelUsageDef::readme_pb(this->hddmBelUsageDef, stream, hddmDevice); HDDMBelUsageDef::setrecursivebelid(this->hddmBelUsageDef, (HIWORD(this->beldef_code1) >> 2) & 0xFFF); } HDDMXng::BelDef::~BelDef((HDDMXng::BelDef *)v75); } void HDDMBelDef::HDDMBelDef(HDDMBelDef *this) { int beldef_code; // eax unsigned int v2; // eax LOWORD(this->beldef_code) &= 0xC000u; LOBYTE(this->beldef_code1) &= 0xF0u; LODWORD(this->char40) = 0; this->qword48 = 0LL; this->qword60 = 0LL; this->hddmPrimitive = 0LL; this->vtable = &`vtable for'HDDMBelDef + 2; beldef_code = this->beldef_code; this->qword30 = 0LL; this->pipsMatrixVec = 0LL; this->hddmBelPinDefArray = 0LL; this->hddmBelUsageDef = 0LL; beldef_code &= 0xF0003FFF; this->beldef_code = beldef_code; HIBYTE(this->beldef_code) = HIBYTE(beldef_code) & 0xCF; v2 = this->beldef_code1 & 0xFFFC000F; this->beldef_code1 = v2; HIWORD(this->beldef_code1) = HIWORD(v2) | 0x3FFC; this->belDef_name = (std::string *)((char *)&std::string::_Rep::_S_empty_rep_storage + 24); this->qword50 = &this->char40; this->qword58 = &this->char40; } void __fastcall HDDMBelDef::~HDDMBelDef(HDDMBelDef *this) { HDDMPrimitive *hddmPrimitive; // rbp _QWORD *vtable; // rbx _QWORD *v4; // rax void *v5; // rdi _QWORD *qword20; // rsi unsigned __int16 v7; // ax __int64 v8; // rbx void *v9; // rdi HDDMBelPinDef *v10; // rdi HDDMBelPinDef *v11; // rbx HDDMBelPinDef *v12; // rbx HDDMBelPinDef *v13; // rdi HDDMBelPinDef *v14; // rbp _QWORD *qword30; // rbx HDDMBelUsageDef *hddmBelUsageDef; // rbx HDDMBelDef *i; // r14 HDDMBelPinDef *hddmBelPinDefArray; // r13 char *pindef_name; // r8 char *v20; // r15 char *v21; // rbx _QWORD *v22; // r9 __int64 v23; // rdx void *v24; // rdi void *v25; // rdi __int64 v26; // rdx __int64 v27; // rdx void *v28; // rdi int v29; // ecx int v30; // ecx char *v31; // [rsp+10h] [rbp-58h] char *v32; // [rsp+10h] [rbp-58h] char *v33; // [rsp+10h] [rbp-58h] char *v34; // [rsp+10h] [rbp-58h] _QWORD *v35; // [rsp+18h] [rbp-50h] _QWORD *v36; // [rsp+18h] [rbp-50h] _QWORD *v37; // [rsp+18h] [rbp-50h] _QWORD *v38; // [rsp+18h] [rbp-50h] _BYTE v39[57]; // [rsp+2Fh] [rbp-39h] BYREF hddmPrimitive = this->hddmPrimitive; this->vtable = &`vtable for'HDDMBelDef + 2; if ( hddmPrimitive ) { vtable = (_QWORD *)hddmPrimitive->vtable; v4 = *(_QWORD **)&hddmPrimitive->numPrimType; if ( (_QWORD *)hddmPrimitive->vtable == v4 ) { v5 = (void *)hddmPrimitive->vtable; } else { do { if ( *vtable ) { (*(void (__fastcall **)(_QWORD))(*(_QWORD *)*vtable + 24LL))(*vtable); hddmPrimitive = this->hddmPrimitive; v4 = *(_QWORD **)&hddmPrimitive->numPrimType; } ++vtable; } while ( vtable != v4 ); v5 = (void *)hddmPrimitive->vtable; } if ( v5 ) operator delete(v5); operator delete(hddmPrimitive); this->hddmPrimitive = 0LL; } qword20 = (_QWORD *)this->pipsMatrixVec; if ( qword20 ) { v7 = (this->beldef_code >> 14) & 0x3FFF; if ( !v7 ) goto LABEL_17; v8 = 0LL; do { v9 = (void *)qword20[v8]; if ( v9 ) { operator delete[](v9); *(_QWORD *)(this->pipsMatrixVec + 8 * v8) = 0LL; qword20 = (_QWORD *)this->pipsMatrixVec; v7 = (this->beldef_code >> 14) & 0x3FFF; } ++v8; } while ( v7 > (int)v8 ); if ( qword20 ) LABEL_17: operator delete[](qword20); this->pipsMatrixVec = 0LL; } if ( this->qword60 ) { for ( i = (HDDMBelDef *)this->qword50; i != (HDDMBelDef *)&this->char40; i = (HDDMBelDef *)std::_Rb_tree_increment(i) ) { hddmBelPinDefArray = i->hddmBelPinDefArray; if ( hddmBelPinDefArray ) { pindef_name = (char *)hddmBelPinDefArray->pindef_name; v20 = *(char **)&hddmBelPinDefArray->pindef_code; if ( pindef_name == *(char **)&hddmBelPinDefArray->pindef_code ) { v25 = (void *)hddmBelPinDefArray->pindef_name; } else { v21 = *(char **)&hddmBelPinDefArray->pindef_code; v22 = v20 + 8; if ( &_pthread_key_create ) { do { v23 = *(_QWORD *)((char *)v22 + v21 - v20); if ( (_UNKNOWN *)(v23 - 24) != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(v23 - 8), 0xFFFFFFFF) <= 0 ) { v36 = v22; v32 = pindef_name; std::string::_Rep::_M_destroy(v23 - 24, v39); v22 = v36; pindef_name = v32; } v24 = (void *)(*(_QWORD *)v21 - 24LL); if ( v24 != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(*(_QWORD *)v21 - 8LL), 0xFFFFFFFF) <= 0 ) { v35 = v22; v31 = pindef_name; std::string::_Rep::_M_destroy(v24, v39); v22 = v35; pindef_name = v31; } v21 += 16; } while ( pindef_name != v21 ); } else { do { v26 = *(_QWORD *)((char *)v22 + v21 - v20); if ( (_UNKNOWN *)(v26 - 24) != &std::string::_Rep::_S_empty_rep_storage ) { v29 = *(_DWORD *)(v26 - 8); *(_DWORD *)(v26 - 8) = v29 - 1; if ( v29 <= 0 ) { v37 = v22; v33 = pindef_name; std::string::_Rep::_M_destroy(v26 - 24, v39); v22 = v37; pindef_name = v33; } } v27 = *(_QWORD *)v21; v28 = (void *)(*(_QWORD *)v21 - 24LL); if ( v28 != &std::string::_Rep::_S_empty_rep_storage ) { v30 = *(_DWORD *)(v27 - 8); *(_DWORD *)(v27 - 8) = v30 - 1; if ( v30 <= 0 ) { v38 = v22; v34 = pindef_name; std::string::_Rep::_M_destroy(v28, v39); v22 = v38; pindef_name = v34; } } v21 += 16; } while ( pindef_name != v21 ); } v25 = *(void **)&hddmBelPinDefArray->pindef_code; } if ( v25 ) operator delete(v25); operator delete(hddmBelPinDefArray); } } } v10 = this->hddmBelPinDefArray; if ( v10 ) { v11 = &v10[v10[-1].pindef_name]; if ( v10 != v11 ) { v12 = v11 - 1; do { v13 = v12; v14 = v12--; HDDMBelPinDef::~HDDMBelPinDef(v13); v10 = this->hddmBelPinDefArray; } while ( v10 != v14 ); } operator delete[](&v10[-1].pindef_name); this->hddmBelPinDefArray = 0LL; } qword30 = (_QWORD *)this->qword30; if ( qword30 ) { std::_Rb_tree<std::string,std::pair<std::string const,HDDMBelPinDef *>,std::_Select1st<std::pair<std::string const,HDDMBelPinDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMBelPinDef *>>>::_M_erase( this->qword30, qword30[2]); operator delete(qword30); this->qword30 = 0LL; } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) { HDDMBelUsageDef::~HDDMBelUsageDef(this->hddmBelUsageDef); operator delete(hddmBelUsageDef); } this->hddmBelUsageDef = 0LL; sub_21726B0(this); std::_Rb_tree<std::pair<unsigned short,unsigned short>,std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>,std::_Select1st<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>,std::less<std::pair<unsigned short,unsigned short>>,std::allocator<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>>::_M_erase( &this->field_38, this->qword48); std::string::_Rep::_M_dispose((char *)this->belDef_name - 24, v39); } void __fastcall HDDMBelDef::writeme_pb(HDDMBelDef *this, std::ostream *stream) { char beldef_code_high; // dl int v3; // eax std::string *v4; // rdi HDDMBelDef *v5; // rax unsigned int beldef_code; // ecx unsigned int beldef_code1; // edx __int16 v8; // ax int v9; // eax __int64 v10; // rdx int v11; // eax _DWORD *v12; // rbp __int64 v13; // rax int v14; // eax unsigned __int16 v15; // cx __int64 qword48; // rax _QWORD *p_char40; // rdx __int64 *v18; // r12 unsigned __int64 v19; // r14 unsigned __int64 i; // r13 __int64 v21; // rbx __int64 v22; // rax __int64 v23; // rdx __int64 v24; // r15 std::string *v25; // rdi const std::string *v26; // r15 __int64 v27; // rdx std::string *v28; // rdi const std::string *v29; // r13 __int64 v30; // rax __int64 v31; // rdx int v32; // esi HDDMBelDef *v33; // rax HDDMPrimitive *hddmPrimitive; // rdx __int64 v35; // rax __int64 v36; // rbx HDDMPrimitive *v37; // rdx __int64 vtable; // rax __int64 v39; // rdx __int64 v40; // rbx __int64 v41; // r13 _DWORD *v42; // rbp const char *v43; // rcx HDDMBelUsageDef *hddmBelUsageDef; // rdi __int64 v45; // [rsp+8h] [rbp-140h] int v47; // [rsp+2Ch] [rbp-11Ch] __int64 v48; // [rsp+38h] [rbp-110h] int v49; // [rsp+44h] [rbp-104h] char v51[16]; // [rsp+60h] [rbp-E8h] BYREF _BYTE v52[16]; // [rsp+70h] [rbp-D8h] BYREF std::string *v53; // [rsp+80h] [rbp-C8h] int v54; // [rsp+88h] [rbp-C0h] char v55; // [rsp+8Ch] [rbp-BCh] char v56; // [rsp+8Dh] [rbp-BBh] char v57; // [rsp+8Eh] [rbp-BAh] int v58; // [rsp+90h] [rbp-B8h] int v59; // [rsp+94h] [rbp-B4h] int v60; // [rsp+9Ch] [rbp-ACh] __int64 v61; // [rsp+C8h] [rbp-80h] BYREF int v62; // [rsp+D0h] [rbp-78h] int v63; // [rsp+D4h] [rbp-74h] int v64; // [rsp+D8h] [rbp-70h] int v65; // [rsp+104h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "BELDEF", 6LL); HDDMXng::BelDef::BelDef((HDDMXng::BelDef *)v52); beldef_code_high = HIBYTE(this->beldef_code); v3 = v65; if ( (beldef_code_high & 0x20) != 0 ) { v56 = 1; v3 = v65 | 2; } if ( (beldef_code_high & 0x10) != 0 ) { v55 = 1; v3 |= 1u; } v4 = v53; v65 = v3 | 4; if ( v53 == (std::string *)&google::protobuf::internal::kEmptyString ) { v4 = (std::string *)operator new(8uLL); *(_QWORD *)v4 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; v53 = v4; } std::string::assign(v4, (const std::string *)&this->belDef_name); v5 = this; beldef_code = this->beldef_code; if ( (beldef_code & 0xFFFC000) != 0 ) { v65 |= 0x10u; v58 = (beldef_code >> 14) & 0x3FFF; v5 = this; } beldef_code1 = v5->beldef_code1; if ( (beldef_code1 & 0x3FFF0) != 0 ) { v65 |= 8u; v54 = (beldef_code1 >> 4) & 0x3FFF; v5 = this; } v8 = v5->beldef_code; if ( (v8 & 0x3FFF) != 0 ) { v65 |= 0x20u; v59 = v8 & 0x3FFF; } if ( this->pipsMatrixVec ) { v9 = (unsigned __int16)((v8 & 0x3FFF) - (((beldef_code >> 14) & 0x3FFF) + ((beldef_code1 >> 4) & 0x3FFF))); v47 = v9 + ((beldef_code1 >> 4) & 0x3FFF); v49 = v9 + ((beldef_code >> 14) & 0x3FFF); if ( v49 ) { v48 = 0LL; do { if ( v47 ) { v45 = 0LL; do { if ( *(_BYTE *)(*(_QWORD *)(this->pipsMatrixVec + 8 * v48) + v45) ) { v10 = v62; v11 = v63; if ( v62 < v63 ) { ++v62; v12 = *(_DWORD **)(v61 + 8 * v10); } else { if ( v63 == v64 ) { google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v61, v63 + 1); v11 = v63; } v63 = v11 + 1; v12 = (_DWORD *)operator new(0x58uLL); HDDMXng::BelDefPip::BelDefPip((HDDMXng::BelDefPip *)v12); v13 = v62++; *(_QWORD *)(v61 + 8 * v13) = v12; } v14 = v12[21] | 3; v12[4] = v48; v12[21] = v14; v12[5] = v45; v15 = v49 + v45; qword48 = this->qword48; if ( qword48 ) { p_char40 = &this->char40; do { while ( (unsigned __int16)v48 <= *(_WORD *)(qword48 + 32) && ((unsigned __int16)v48 < *(_WORD *)(qword48 + 32) || *(_WORD *)(qword48 + 34) >= v15) ) { p_char40 = (_QWORD *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_33; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_33: if ( &this->char40 != p_char40 && (unsigned __int16)v48 >= *((_WORD *)p_char40 + 16) && ((unsigned __int16)v48 > *((_WORD *)p_char40 + 16) || *((_WORD *)p_char40 + 17) <= v15) ) { v18 = (__int64 *)p_char40[5]; if ( (v18[1] - *v18) >> 4 ) { v19 = 1LL; for ( i = 0LL; ; i = v19++ ) { v30 = (int)v12[8]; v32 = v12[9]; if ( (int)v30 >= v32 ) { if ( v32 == v12[10] ) { google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)(v12 + 6), v32 + 1); v32 = v12[9]; } v12[9] = v32 + 1; v21 = operator new(0x28uLL); HDDMXng::AttrSetting::AttrSetting((HDDMXng::AttrSetting *)v21); v22 = (int)v12[8]; v23 = *((_QWORD *)v12 + 3); v12[8] = v22 + 1; *(_QWORD *)(v23 + 8 * v22) = v21; } else { v31 = *((_QWORD *)v12 + 3); v12[8] = v30 + 1; v21 = *(_QWORD *)(v31 + 8 * v30); } v24 = *v18; if ( (v18[1] - *v18) >> 4 <= i ) std::__throw_out_of_range("vector::_M_range_check"); *(_DWORD *)(v21 + 36) |= 1u; v25 = *(std::string **)(v21 + 16); v26 = (const std::string *)(16 * i + v24); if ( v25 == (std::string *)&google::protobuf::internal::kEmptyString ) { v25 = (std::string *)operator new(8uLL); *(_QWORD *)v25 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(v21 + 16) = v25; } std::string::assign(v25, v26); v27 = *v18; if ( (v18[1] - *v18) >> 4 <= i ) std::__throw_out_of_range("vector::_M_range_check"); *(_DWORD *)(v21 + 36) |= 2u; v28 = *(std::string **)(v21 + 24); v29 = (const std::string *)(v27 + 16 * i + 8); if ( v28 == (std::string *)&google::protobuf::internal::kEmptyString ) { v28 = (std::string *)operator new(8uLL); *(_QWORD *)v28 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(v21 + 24) = v28; } std::string::assign(v28, v29); if ( (v18[1] - *v18) >> 4 <= v19 ) break; } } } } } ++v45; } while ( v47 > (int)v45 ); } ++v48; } while ( v49 > (int)v48 ); } } v33 = this; hddmPrimitive = this->hddmPrimitive; if ( hddmPrimitive ) { v35 = *(_QWORD *)&hddmPrimitive->numPrimType - hddmPrimitive->vtable; v65 |= 0x80u; v60 = v35 >> 3; v33 = this; } if ( v33->hddmBelUsageDef ) { v65 |= 0x400u; v57 = 1; } HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v52, (const google::protobuf::Message *)hddmPrimitive); if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "PINS", 4LL); v36 = 0LL; if ( (this->beldef_code & 0x3FFF) != 0 ) { do HDDMBelPinDef::writeme_pb(&this->hddmBelPinDefArray[v36++], stream); while ( (this->beldef_code & 0x3FFF) > (int)v36 ); } if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "PRIMS", 5LL); v37 = this->hddmPrimitive; if ( v37 ) { vtable = v37->vtable; v39 = (__int64)(*(_QWORD *)&v37->numPrimType - v37->vtable) >> 3; if ( (int)v39 > 0 ) { v40 = 0LL; v41 = 8LL * (unsigned int)(v39 - 1) + 8; while ( 1 ) { v42 = *(_DWORD **)(vtable + v40); *(_WORD *)v51 = v42[2]; std::ostream::write(stream, v51, 2LL); HDDMDeviceDump::dumpbinary((HDDMDeviceDump *)v51, (const char *)&dword_0 + 2, (int)"beldef:", v43); (*(void (__fastcall **)(_DWORD *, std::ostream *))(*(_QWORD *)v42 + 8LL))(v42, stream); v40 += 8LL; if ( v40 == v41 ) break; vtable = this->hddmPrimitive->vtable; } } } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) HDDMBelUsageDef::writeme_pb(hddmBelUsageDef, stream); HDDMXng::BelDef::~BelDef((HDDMXng::BelDef *)v52); } void __fastcall HDDMBelDef::print(HDDMBelDef *this, std::ostream *stream, const std::string *filename) { __int64 v4; // rbp __int64 v5; // rax __int64 v6; // r12 __int64 v7; // rax __int64 v8; // rbp __int64 v9; // r12 __int64 v10; // r14 __int64 v11; // rbp __int64 v12; // rbp __int64 v13; // rax __int64 v14; // r12 __int64 v15; // rbp __int64 v16; // r14 __int64 v17; // r12 __int64 v18; // r12 __int64 v19; // rax HDDMPrimitive *hddmPrimitive; // rdx __int64 vtable; // rax __int64 v22; // rdx __int64 v23; // r12 __int64 v24; // r14 char v25; // al std::ostream *v26; // rax std::ostream *v27; // rbp __int64 v28; // rax __int64 v29; // rdx __int16 beldef_code; // ax __int64 v31; // r14 int v32; // ebp __int64 v33; // rax _BYTE *v34; // r12 char v35; // al std::ostream *v36; // rax __int64 v37; // rbp int v38; // eax __int64 v39; // rbp __int64 v40; // rax __int64 v41; // r14 std::ostream *v42; // r14 __int64 v43; // rax char v44; // al std::ostream *v45; // rax __int64 v46; // rbp HDDMBelUsageDef *hddmBelUsageDef; // rdi __int64 v48; // rax __int64 v49; // rax unsigned __int16 v50; // [rsp+0h] [rbp-58h] unsigned __int16 v51; // [rsp+0h] [rbp-58h] __int64 v52; // [rsp+0h] [rbp-58h] int v53; // [rsp+0h] [rbp-58h] unsigned int v54; // [rsp+8h] [rbp-50h] __int64 v55; // [rsp+8h] [rbp-50h] __int64 v56; // [rsp+10h] [rbp-48h] int v57; // [rsp+1Ch] [rbp-3Ch] v4 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v4, "BELDEF ", 7LL); v5 = std::__ostream_insert<char,std::char_traits<char>>(v4, this->belDef_name, *((_QWORD *)this->belDef_name - 3)); std::endl<char,std::char_traits<char>>(v5); LOBYTE(v4) = this->beldef_code1 & 0xF; v6 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v6, " m_deviceid : ", 14LL); v7 = std::ostream::_M_insert<unsigned long>(v6, (unsigned __int8)v4); std::endl<char,std::char_traits<char>>(v7); v8 = HIBYTE(this->beldef_code) >> 5; v50 = (this->beldef_code >> 14) & 0x3FFF; v9 = this->beldef_code & 0x3FFF; v10 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v10, "m_rbel : ", 9LL); v11 = std::ostream::_M_insert<unsigned long>(v10, v8 & 1); std::__ostream_insert<char,std::char_traits<char>>(v11, " m_numpins: ", 12LL); v12 = std::ostream::_M_insert<unsigned long>(v11, (unsigned __int16)v9); std::__ostream_insert<char,std::char_traits<char>>(v12, " m_numinputpins : ", 18LL); v13 = std::ostream::_M_insert<unsigned long>(v12, v50); std::endl<char,std::char_traits<char>>(v13); v14 = HIBYTE(this->beldef_code) >> 4; v51 = (this->beldef_code1 >> 4) & 0x3FFF; v15 = HIWORD(this->beldef_code1) >> 2; v16 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v16, "m_optinv : ", 11LL); v17 = std::ostream::_M_insert<unsigned long>(v16, v14 & 1); std::__ostream_insert<char,std::char_traits<char>>(v17, " m_numoutputpins : ", 19LL); v18 = std::ostream::_M_insert<unsigned long>(v17, v51); std::__ostream_insert<char,std::char_traits<char>>(v18, " m_index : ", 11LL); v19 = std::ostream::_M_insert<unsigned long>(v18, v15 & 0xFFF); std::endl<char,std::char_traits<char>>(v19); hddmPrimitive = this->hddmPrimitive; if ( hddmPrimitive ) { vtable = hddmPrimitive->vtable; v22 = (__int64)(*(_QWORD *)&hddmPrimitive->numPrimType - hddmPrimitive->vtable) >> 3; if ( (int)v22 > 0 ) { v23 = 0LL; v24 = 8LL * (unsigned int)(v22 - 1) + 8; while ( 1 ) { (*(void (__fastcall **)(_QWORD, std::ostream *, const std::string *))(**(_QWORD **)(vtable + v23) + 32LL))( *(_QWORD *)(vtable + v23), stream, filename); v27 = (std::ostream *)std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v27, ";", 1LL); v28 = *(_QWORD *)(*(_QWORD *)v27 - 24LL); v29 = *(_QWORD *)((char *)v27 + v28 + 240); if ( !v29 ) break; if ( *(_BYTE *)(v29 + 56) ) { v25 = *(_BYTE *)(v29 + 67); } else { v52 = *(_QWORD *)((char *)v27 + v28 + 240); std::ctype<char>::_M_widen_init(v52); v25 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v52 + 48LL))(v52, 10LL); } v23 += 8LL; v26 = (std::ostream *)std::ostream::put(v27, v25); std::ostream::flush(v26); if ( v23 == v24 ) goto LABEL_10; vtable = this->hddmPrimitive->vtable; } LABEL_39: std::__throw_bad_cast(); } } LABEL_10: beldef_code = this->beldef_code; if ( (beldef_code & 0x3FFF) != 0 ) { v48 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); v49 = std::operator<<<std::char_traits<char>>(v48, "PINS : "); std::endl<char,std::char_traits<char>>(v49); beldef_code = this->beldef_code; } v31 = 0LL; v32 = 0; while ( v32 < (beldef_code & 0x3FFF) ) { ++v32; HDDMBelPinDef::print(&this->hddmBelPinDefArray[v31], stream, filename); if ( v32 == (this->beldef_code & 0x3FFF) ) { std::__ostream_insert<char,std::char_traits<char>>(stream, ";", 1LL); std::endl<char,std::char_traits<char>>(stream); } else { std::__ostream_insert<char,std::char_traits<char>>(stream, ",", 1LL); v33 = *(_QWORD *)(*(_QWORD *)stream - 24LL); v34 = *(_BYTE **)((char *)stream + v33 + 240); if ( !v34 ) goto LABEL_39; if ( v34[56] ) { v35 = v34[67]; } else { std::ctype<char>::_M_widen_init(*(_QWORD *)((char *)stream + v33 + 240)); v35 = (*(__int64 (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v34 + 48LL))(v34, 10LL); } v36 = (std::ostream *)std::ostream::put(stream, v35); std::ostream::flush(v36); } beldef_code = this->beldef_code; ++v31; } if ( this->pipsMatrixVec ) { v37 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v37, "PIPS:", 5LL); std::endl<char,std::char_traits<char>>(v37); v38 = (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code1 >> 4) & 0x3FFF) + ((this->beldef_code >> 14) & 0x3FFF))); v53 = v38 + ((this->beldef_code1 >> 4) & 0x3FFF); v57 = v38 + ((this->beldef_code >> 14) & 0x3FFF); if ( v57 ) { v56 = 0LL; while ( !v53 ) { LABEL_33: if ( v57 <= (int)++v56 ) goto LABEL_34; } v39 = 0LL; while ( 1 ) { while ( !*(_BYTE *)(*(_QWORD *)(this->pipsMatrixVec + 8 * v56) + v39) ) { if ( v53 <= (int)++v39 ) goto LABEL_33; } v54 = ((this->beldef_code >> 14) & 0x3FFF) + v39; v40 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); v41 = std::ostream::operator<<(v40, (unsigned int)v56); std::__ostream_insert<char,std::char_traits<char>>(v41, " : ", 3LL); v42 = (std::ostream *)std::ostream::operator<<(v41, v54); std::__ostream_insert<char,std::char_traits<char>>(v42, ",", 1LL); v43 = *(_QWORD *)((char *)v42 + *(_QWORD *)(*(_QWORD *)v42 - 24LL) + 240); if ( !v43 ) goto LABEL_39; if ( *(_BYTE *)(v43 + 56) ) { v44 = *(_BYTE *)(v43 + 67); } else { v55 = *(_QWORD *)((char *)v42 + *(_QWORD *)(*(_QWORD *)v42 - 24LL) + 240); std::ctype<char>::_M_widen_init(v55); v44 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v55 + 48LL))(v55, 10LL); } ++v39; v45 = (std::ostream *)std::ostream::put(v42, v44); std::ostream::flush(v45); if ( v53 <= (int)v39 ) goto LABEL_33; } } LABEL_34: v46 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)filename, *(_QWORD *)(*(_QWORD *)filename - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v46, ";", 1LL); std::endl<char,std::char_traits<char>>(v46); } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) HDDMBelUsageDef::print(hddmBelUsageDef, stream, filename); }
10-28
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 特别注意: 1.保持所有原始功能不变 2.提高执行效率,降低计算复杂度 3.已经给定的结构体名字和元素不要更改,详细的中文注释 4.自动添加中文注释说明功能逻辑 5.不使用 auto,使用显式 for 循环 6.结构体采用32位定义 7.不要使用小函数,保持原始的函数定义 特别注意: 1. 函数中 HDDMXng::Architecture::Architecture 映射为 message Architecture { optional string name = 1; repeated string intentcodes = 2; repeated string costcodes = 3; repeated string speednames = 4; optional uint32 numlbels = 5; optional uint32 numbeldefs = 6; optional uint32 numsitetypes = 7; optional uint32 numtiletypes = 8; optional uint32 flags = 9; } 2. 将 arch_msg 映射为 HDDMXng::Architecture arch_msg; 3. 采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 进行编程 void __fastcall HDDMDevice::readarch_pb(HDDMDevice *this, const std::string *filePath, unsigned __int16 nFileVersion) { google::protobuf::Message *v5; // rdx const std::string *v6; // rsi int v7; // ebp int v8; // r13d __int64 v9; // rbp const std::string **v10; // rax __int64 qword50_1; // rdx __int64 v12; // r12 std::string *qword50; // rdi const std::string *v14; // rsi std::string *qword68; // rdi __int64 qword68_1; // rax HDDMDevice *qword230; // r14 char *s2_1; // rbp HDDMDevice *p_char228; // r12 size_t n_2; // r15 int n0x7FFFFFFF_1; // eax _QWORD *s1; // rdi size_t n; // rdx size_t n_3; // r13 __int64 n0x7FFFFFFF; // r13 int p_qword90_2; // r15d HDDMBelDef *v27; // rbp HDDMBelDef **qword80; // rax bool v29; // zf __int64 qword80_1; // rax HDDMTileType *v31; // rdi char *qword290; // r14 _QWORD *s2_2; // rbp char *p_char288; // r12 size_t n_5; // r15 int n0x7FFFFFFF_3; // eax _QWORD *s1_1; // rdi size_t n_4; // r13 size_t n_1; // rdx __int64 n0x7FFFFFFF_2; // r13 HDDMTileType *v41; // r14 int v42; // r15d char *p_char2B8; // r15 int v44; // r13d HDDMSiteType *s2_4; // rbp HDDMSiteType **qword98; // rax __int64 qword98_1; // rax HDDMSiteType *s2_5; // rdi char *qword2C0; // r14 char *p_char2B8_1; // rbp int v51; // r15d char *p_char258; // r14 int v53; // r15d HDDMTileType *v54; // rbp HDDMTileType **qwordB0; // rax __int64 qwordB0_1; // rax HDDMTileType *v57; // rdi HDDMTileType **qword260; // r13 HDDMTileType **p_char258_1; // rbp __int64 p_char258_2; // rax __int64 insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_; // rax HDDMTileType **p_qword90a_1; // rdx __int64 v63; // rdi char *p_char2B8_2; // rax __int64 v65; // rax __int64 insert_hint_unique_pos; // rax char *p_char2B8_3; // rdx __int64 v68; // rdi __int64 p_char288_1; // rax __int64 p_char228_1; // rax unsigned int v71; // eax unsigned int v72; // eax __int64 v73; // r12 __int64 v74; // rbp __int64 qword1E0_1; // rax std::string *qword1E0; // rdi const std::string *v77; // rsi int v78; // [rsp+0h] [rbp-538h] int word28_1; // [rsp+8h] [rbp-530h] int word28_3; // [rsp+8h] [rbp-530h] _QWORD *v81; // [rsp+8h] [rbp-530h] void **p_s2; // [rsp+10h] [rbp-528h] std::string *v83; // [rsp+18h] [rbp-520h] std::string *s2_3; // [rsp+18h] [rbp-520h] int v85; // [rsp+18h] [rbp-520h] int dword154a; // [rsp+20h] [rbp-518h] int dword154b[2]; // [rsp+20h] [rbp-518h] int dword154c[2]; // [rsp+20h] [rbp-518h] int dword154d[2]; // [rsp+20h] [rbp-518h] unsigned int word28_2; // [rsp+28h] [rbp-510h] std::istream *v91; // [rsp+28h] [rbp-510h] std::istream *v92; // [rsp+28h] [rbp-510h] HUTMemWatcher *v93; // [rsp+30h] [rbp-508h] std::string *v94; // [rsp+38h] [rbp-500h] HDDMXng::TileType *v95; // [rsp+40h] [rbp-4F8h] int p_qword90; // [rsp+48h] [rbp-4F0h] HDDMTileType **p_qword90a; // [rsp+48h] [rbp-4F0h] HDDMTileType **p_qword60; // [rsp+50h] [rbp-4E8h] _QWORD *p_qwordA8; // [rsp+58h] [rbp-4E0h] int *v100; // [rsp+60h] [rbp-4D8h] _QWORD *p_qword78; // [rsp+68h] [rbp-4D0h] _QWORD *v102; // [rsp+70h] [rbp-4C8h] int v103; // [rsp+78h] [rbp-4C0h] HDDMXng::Architecture *v105; // [rsp+80h] [rbp-4B8h] HUTMemWatcher *v106; // [rsp+88h] [rbp-4B0h] char v107; // [rsp+9Eh] [rbp-49Ah] BYREF char v108; // [rsp+9Fh] [rbp-499h] BYREF char v109[16]; // [rsp+A0h] [rbp-498h] BYREF _QWORD v110[2]; // [rsp+B0h] [rbp-488h] BYREF _QWORD v111[2]; // [rsp+C0h] [rbp-478h] BYREF _QWORD v112[2]; // [rsp+D0h] [rbp-468h] BYREF _QWORD v113[2]; // [rsp+E0h] [rbp-458h] BYREF _QWORD v114[2]; // [rsp+F0h] [rbp-448h] BYREF _QWORD v115[2]; // [rsp+100h] [rbp-438h] BYREF int v116[2]; // [rsp+110h] [rbp-428h] BYREF _QWORD v117[2]; // [rsp+120h] [rbp-418h] BYREF _QWORD v118[2]; // [rsp+130h] [rbp-408h] BYREF HDDMTileType *v119[2]; // [rsp+140h] [rbp-3F8h] BYREF void *s2; // [rsp+150h] [rbp-3E8h] BYREF int v121; // [rsp+158h] [rbp-3E0h] BYREF __int64 v122; // [rsp+160h] [rbp-3D8h] int *v123; // [rsp+168h] [rbp-3D0h] int *v124; // [rsp+170h] [rbp-3C8h] __int64 v125; // [rsp+178h] [rbp-3C0h] _BYTE v126[176]; // [rsp+180h] [rbp-3B8h] BYREF _QWORD v127[22]; // [rsp+230h] [rbp-308h] BYREF _QWORD arch_msg[4]; // [rsp+2E0h] [rbp-258h] BYREF int v129; // [rsp+300h] [rbp-238h] __int64 v130; // [rsp+330h] [rbp-208h] int v131; // [rsp+338h] [rbp-200h] __int64 v132; // [rsp+368h] [rbp-1D0h] unsigned int word28_4; // [rsp+370h] [rbp-1C8h] int word28; // [rsp+3A0h] [rbp-198h] int p_qword90_1; // [rsp+3A4h] [rbp-194h] int v136; // [rsp+3A8h] [rbp-190h] int v137; // [rsp+3ACh] [rbp-18Ch] int v138; // [rsp+3B0h] [rbp-188h] _QWORD v139[2]; // [rsp+3C0h] [rbp-178h] BYREF _BYTE v140[360]; // [rsp+3D0h] [rbp-168h] BYREF p_s2 = &s2; v102 = v139; std::string::string(v139, "", &s2); v94 = (std::string *)v119; v105 = (HDDMXng::Architecture *)arch_msg; std::string::string(arch_msg, "device:readFamilyXng", v119); v106 = (HUTMemWatcher *)v126; HUTMemWatcher::HUTMemWatcher((HUTMemWatcher *)v126, (const std::string *)arch_msg, (const std::string *)v139); v93 = (HUTMemWatcher *)v127; std::string::_Rep::_M_dispose(arch_msg[0] - 24LL, v127); std::string::_Rep::_M_dispose(v139[0] - 24LL, arch_msg); sub_1F9A060(v139, *(_QWORD *)filePath, 4, 0); this->gap310[16] = nFileVersion > 1u; this->dword154 = nFileVersion; std::istream::read((std::istream *)v140, v109, 8); HDDMXng::Architecture::Architecture((HDDMXng::Architecture *)arch_msg); HDDMDevice::readMessage((HDDMDevice *)v140, (std::istream *)arch_msg, v5); v6 = (const std::string *)arch_msg[2]; this->word28 = word28; std::string::assign((std::string *)&this->qword30, v6); HDDMDevice::setupArchSpecific(this); v7 = v129; if ( v129 ) { this->byte1F0 = 1; std::vector<std::string>::reserve(&this->char1D8, v7); if ( v7 > 0 ) { v73 = 8LL * (unsigned int)(v7 - 1) + 8; v74 = 0; do { qword1E0 = (std::string *)this->qword1E0; v77 = *(const std::string **)(arch_msg[3] + v74); if ( qword1E0 == (std::string *)this->qword1E8 ) { std::vector<std::string>::_M_emplace_back_aux<std::string const&>(&this->char1D8, v77); } else { if ( qword1E0 ) { std::string::string(qword1E0, v77); qword1E0_1 = this->qword1E0; } else { qword1E0_1 = 0; } this->qword1E0 = qword1E0_1 + 8; } v74 += 8; } while ( v74 != v73 ); } } v8 = v131; if ( v131 ) { std::vector<std::string>::reserve(&this->char48, v131); if ( v8 > 0 ) { v9 = 0; do { v12 = 8 * v9; qword50 = (std::string *)this->qword50; v10 = (const std::string **)(v130 + 8 * v9); v14 = *v10; if ( qword50 == (std::string *)this->qword58 ) { std::vector<std::string>::_M_emplace_back_aux<std::string const&>(&this->char48, v14); v10 = (const std::string **)(v130 + v12); } else { if ( qword50 ) { std::string::string(qword50, v14); v10 = (const std::string **)(v130 + v12); qword50_1 = this->qword50; } else { qword50_1 = 0; } this->qword50 = qword50_1 + 8; } *(_WORD *)std::map<std::string,unsigned short>::operator[](this->gap2E0, *v10) = v9++; } while ( v8 > (int)v9 ); } } p_qword60 = (HDDMTileType **)&this->qword60; word28_2 = word28_4; std::vector<std::string>::reserve(&this->qword60, word28_4); v83 = 0; word28_1 = 0; if ( word28_2 ) { do { std::string::string((std::string *)&s2, *(const std::string **)((char *)v83 + v132)); qword68 = (std::string *)this->qword68; if ( qword68 == (std::string *)this->qword70 ) { std::vector<std::string>::_M_emplace_back_aux<std::string const&>(p_qword60, &s2); } else { if ( qword68 ) { std::string::string(qword68, (const std::string *)&s2); qword68_1 = this->qword68; } else { qword68_1 = 0; } this->qword68 = qword68_1 + 8; } qword230 = (HDDMDevice *)this->qword230; if ( !qword230 ) { p_char228 = (HDDMDevice *)&this->char228; LABEL_97: v127[0] = &s2; p_char228_1 = std::_Rb_tree<std::string,std::pair<std::string const,unsigned short>,std::_Select1st<std::pair<std::string const,unsigned short>>,std::less<std::string>,std::allocator<std::pair<std::string const,unsigned short>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&,std::tuple<std::string const&>,std::tuple<>>( this->gap220, p_char228, &unk_7B5DE75, v127, &v107); s2_1 = (char *)s2; p_char228 = (HDDMDevice *)p_char228_1; goto LABEL_30; } s2_1 = (char *)s2; p_char228 = (HDDMDevice *)&this->char228; n_2 = *((_QWORD *)s2 - 3); do { while ( 1 ) { s1 = *(_QWORD **)&qword230->dword20; n = n_2; n_3 = *(s1 - 3); if ( n_3 <= n_2 ) n = *(s1 - 3); n0x7FFFFFFF_1 = memcmp(s1, s2_1, n); if ( !n0x7FFFFFFF_1 ) break; LABEL_20: if ( n0x7FFFFFFF_1 < 0 ) goto LABEL_27; LABEL_21: p_char228 = qword230; qword230 = *(HDDMDevice **)&qword230->word10; if ( !qword230 ) goto LABEL_28; } n0x7FFFFFFF = n_3 - n_2; if ( n0x7FFFFFFF > 0x7FFFFFFF ) goto LABEL_21; if ( n0x7FFFFFFF >= (__int64)0xFFFFFFFF80000000LL ) { n0x7FFFFFFF_1 = n0x7FFFFFFF; goto LABEL_20; } LABEL_27: qword230 = *(HDDMDevice **)&qword230->dword18; } while ( qword230 ); LABEL_28: if ( &this->char228 == (char *)p_char228 || (int)std::string::compare((std::string *)&s2, (const std::string *)&p_char228->dword20) < 0 ) { goto LABEL_97; } LABEL_30: p_char228->word28 = word28_1; std::string::_Rep::_M_dispose(s2_1 - 24, v127); ++word28_1; v83 = (std::string *)((char *)v83 + 8); } while ( word28_1 != word28_2 ); } std::string::string(v111, "", v119); v95 = (HDDMXng::TileType *)v118; std::string::string(v110, "device::ArchXngBelDefs", v118); HUTMemWatcher::HUTMemWatcher((HUTMemWatcher *)v127, (const std::string *)v110, (const std::string *)v111); std::string::_Rep::_M_dispose(v110[0] - 24LL, &s2); std::string::_Rep::_M_dispose(v111[0] - 24LL, &s2); p_qword78 = &this->hddmBelDefVec; p_qword90_2 = p_qword90_1; p_qword90 = p_qword90_1; std::vector<HDDMBelDef *>::reserve(&this->hddmBelDefVec, p_qword90_1); if ( p_qword90_2 <= 0 ) goto LABEL_54; word28_3 = 0; LODWORD(p_qword60) = nFileVersion; do { if ( (unsigned __int16)this->word28 <= word28_3 ) { v27 = (HDDMBelDef *)operator new(0x70u); HDDMBelDef::HDDMBelDef(v27); *((_BYTE *)v27 + 11) |= 0x20u; *(_QWORD *)v27 = off_96B67F0; } else { v27 = (HDDMBelDef *)operator new(0x70u); HDDMBelDef::HDDMBelDef(v27); *(_QWORD *)v27 = off_96B67B0; } qword80 = (HDDMBelDef **)this->qword80; v29 = qword80 == (HDDMBelDef **)this->qword88; v119[0] = v27; if ( v29 ) { std::vector<HDDMBelDef *>::_M_emplace_back_aux<HDDMBelDef * const&>(p_qword78, v119); v31 = v119[0]; } else { if ( qword80 ) { *qword80 = v27; qword80_1 = this->qword80; v31 = v119[0]; } else { v31 = v27; qword80_1 = 0; } this->qword80 = qword80_1 + 8; } *((_WORD *)v31 + 7) = (4 * (word28_3 & 0xFFF)) | *((_WORD *)v31 + 7) & 0xC003; (*(void (__fastcall **)(HDDMTileType *, _BYTE *, HDDMDevice *, _QWORD))(*(_QWORD *)v31 + 32LL))( v31, v140, this, nFileVersion); qword290 = (char *)this->qword290; v91 = v119[0]; s2_3 = (HDDMTileType *)((char *)v119[0] + 16); if ( !qword290 ) { p_char288 = &this->char288; goto LABEL_95; } s2_2 = (_QWORD *)*((_QWORD *)v119[0] + 2); p_char288 = &this->char288; n_5 = *(s2_2 - 3); do { while ( 1 ) { s1_1 = (_QWORD *)*((_QWORD *)qword290 + 4); n_4 = *(s1_1 - 3); n_1 = n_4; if ( n_5 <= n_4 ) n_1 = n_5; n0x7FFFFFFF_3 = memcmp(s1_1, s2_2, n_1); if ( !n0x7FFFFFFF_3 ) break; LABEL_42: if ( n0x7FFFFFFF_3 < 0 ) goto LABEL_49; LABEL_43: p_char288 = qword290; qword290 = (char *)*((_QWORD *)qword290 + 2); if ( !qword290 ) goto LABEL_50; } n0x7FFFFFFF_2 = n_4 - n_5; if ( n0x7FFFFFFF_2 > 0x7FFFFFFF ) goto LABEL_43; if ( n0x7FFFFFFF_2 >= (__int64)0xFFFFFFFF80000000LL ) { n0x7FFFFFFF_3 = n0x7FFFFFFF_2; goto LABEL_42; } LABEL_49: qword290 = (char *)*((_QWORD *)qword290 + 3); } while ( qword290 ); LABEL_50: if ( &this->char288 != p_char288 && (int)std::string::compare(s2_3, (const std::string *)(p_char288 + 32)) >= 0 ) { v41 = v91; goto LABEL_53; } LABEL_95: s2 = s2_3; p_char288_1 = std::_Rb_tree<std::string,std::pair<std::string const,HDDMBelDef *>,std::_Select1st<std::pair<std::string const,HDDMBelDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMBelDef *>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&,std::tuple<std::string const&>,std::tuple<>>( this->gap280, p_char288, &unk_7B5DE75, &s2, &v108); v41 = v119[0]; p_char288 = (char *)p_char288_1; LABEL_53: ++word28_3; *((_QWORD *)p_char288 + 5) = v41; } while ( p_qword90 != word28_3 ); LABEL_54: HUTMemWatcher::~HUTMemWatcher((HUTMemWatcher *)v127); std::string::string(v113, "", v119); std::string::string(v112, "device::ArchXngSiteTypes", v118); HUTMemWatcher::HUTMemWatcher((HUTMemWatcher *)v127, (const std::string *)v112, (const std::string *)v113); std::string::_Rep::_M_dispose(v112[0] - 24LL, &s2); std::string::_Rep::_M_dispose(v113[0] - 24LL, &s2); p_qword90a = (HDDMTileType **)&this->qword90; v42 = v136; LODWORD(v81) = v136; std::vector<HDDMSiteType *>::reserve(&this->qword90, v136); if ( v42 > 0 ) { p_char2B8 = &this->char2B8; v44 = 0; do { s2_4 = (HDDMSiteType *)operator new(0x170u); HDDMSiteType::HDDMSiteType(s2_4); qword98 = (HDDMSiteType **)this->qword98; v29 = qword98 == (HDDMSiteType **)this->qwordA0; s2 = s2_4; if ( v29 ) { std::vector<HDDMSiteType *>::_M_emplace_back_aux<HDDMSiteType * const&>(p_qword90a, &s2); s2_5 = (HDDMSiteType *)s2; } else { if ( qword98 ) { *qword98 = s2_4; qword98_1 = this->qword98; s2_5 = (HDDMSiteType *)s2; } else { s2_5 = s2_4; qword98_1 = 0; } this->qword98 = qword98_1 + 8; } *((_WORD *)s2_5 + 5) = ((_WORD)v44 << 6) | *((_WORD *)s2_5 + 5) & 0x3F; HDDMSiteType::readme_pb(s2_5, (std::istream *)v140, this); std::string::string((std::string *)v114, (const std::string *)((char *)s2 + 32)); qword2C0 = (char *)this->qword2C0; p_char2B8_1 = &this->char2B8; if ( !qword2C0 ) goto LABEL_89; do { while ( (int)std::string::compare((std::string *)(qword2C0 + 32), (const std::string *)v114) >= 0 ) { p_char2B8_1 = qword2C0; qword2C0 = (char *)*((_QWORD *)qword2C0 + 2); if ( !qword2C0 ) goto LABEL_65; } qword2C0 = (char *)*((_QWORD *)qword2C0 + 3); } while ( qword2C0 ); LABEL_65: if ( p_char2B8_1 == p_char2B8 || (int)std::string::compare((std::string *)v114, (const std::string *)(p_char2B8_1 + 32)) < 0 ) { LABEL_89: *(_QWORD *)dword154b = p_char2B8_1; p_char2B8_2 = (char *)operator new(0x30u); p_char2B8_1 = p_char2B8_2; if ( p_char2B8_2 ) { *(_DWORD *)p_char2B8_2 = 0; v65 = v114[0]; *((_QWORD *)p_char2B8_1 + 1) = 0; *((_QWORD *)p_char2B8_1 + 2) = 0; *((_QWORD *)p_char2B8_1 + 3) = 0; *((_QWORD *)p_char2B8_1 + 5) = 0; *((_QWORD *)p_char2B8_1 + 4) = v65; v114[0] = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; } insert_hint_unique_pos = std::_Rb_tree<std::string,std::pair<std::string const,HDDMSiteType *>,std::_Select1st<std::pair<std::string const,HDDMSiteType *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMSiteType *>>>::_M_get_insert_hint_unique_pos( this->gap2B0, *(_QWORD *)dword154b, p_char2B8_1 + 32); if ( p_char2B8_3 ) { v68 = 1; if ( !insert_hint_unique_pos && p_char2B8 != p_char2B8_3 ) { *(_QWORD *)dword154d = p_char2B8_3; v72 = std::string::compare((std::string *)(p_char2B8_1 + 32), (const std::string *)(p_char2B8_3 + 32)); p_char2B8_3 = *(char **)dword154d; v68 = v72 >> 31; } std::_Rb_tree_insert_and_rebalance(v68, p_char2B8_1, p_char2B8_3, &this->char2B8); ++this->qword2D8; } else { *(_QWORD *)dword154c = insert_hint_unique_pos; std::string::_Rep::_M_dispose(*((_QWORD *)p_char2B8_1 + 4) - 24LL, v119); operator delete(p_char2B8_1); p_char2B8_1 = *(char **)dword154c; } } ++v44; *((_QWORD *)p_char2B8_1 + 5) = s2; std::string::_Rep::_M_dispose(v114[0] - 24LL, v119); } while ( (_DWORD)v81 != v44 ); } HUTMemWatcher::~HUTMemWatcher((HUTMemWatcher *)v127); v100 = v116; std::string::string(v116, "", v119); std::string::string(v115, "device::ArchXngTileTypes", v118); HUTMemWatcher::HUTMemWatcher((HUTMemWatcher *)v127, (const std::string *)v115, (const std::string *)v116); std::string::_Rep::_M_dispose(v115[0] - 24LL, &s2); std::string::_Rep::_M_dispose(*(_QWORD *)v116 - 24LL, &s2); v121 = 0; v122 = 0; v125 = 0; v123 = &v121; v124 = &v121; p_qwordA8 = &this->qwordA8; v51 = v137; v85 = v137; std::vector<HDDMTileType *>::reserve(&this->qwordA8, v137); if ( v51 > 0 ) { p_char258 = &this->char258; v53 = 0; dword154a = nFileVersion; v92 = (std::istream *)v140; do { v54 = (HDDMTileType *)operator new(0x2A0u); HDDMTileType::HDDMTileType(v54); qwordB0 = (HDDMTileType **)this->qwordB0; v29 = qwordB0 == (HDDMTileType **)this->qwordB8; v119[0] = v54; if ( v29 ) { std::vector<HDDMTileType *>::_M_emplace_back_aux<HDDMTileType * const&>(p_qwordA8, v94); v57 = v119[0]; } else { if ( qwordB0 ) { *qwordB0 = v54; qwordB0_1 = this->qwordB0; v57 = v119[0]; } else { v57 = v54; qwordB0_1 = 0; } this->qwordB0 = qwordB0_1 + 8; } HDDMTileType::readme_pb( v57, v92, v78, (int)v81, (int)p_s2, v85, dword154a, (int)v92, (int)v93, (int)v94, v95, (int)p_qword90a, (int)p_qword60, p_qwordA8, (int)v100, p_qword78, (int)v102, v103, (int)v105, (__int64)v106); v81 = v117; HDDMTileType::getName((HDDMTileType *)v117); qword260 = (HDDMTileType **)this->qword260; p_char258_1 = (HDDMTileType **)&this->char258; if ( !qword260 ) goto LABEL_84; do { while ( (int)std::string::compare((std::string *)(qword260 + 4), (const std::string *)v117) >= 0 ) { p_char258_1 = qword260; qword260 = (HDDMTileType **)qword260[2]; if ( !qword260 ) goto LABEL_79; } qword260 = (HDDMTileType **)qword260[3]; } while ( qword260 ); LABEL_79: if ( p_char258_1 == (HDDMTileType **)p_char258 || (int)std::string::compare((std::string *)v117, (const std::string *)(p_char258_1 + 4)) < 0 ) { LABEL_84: p_qword60 = p_char258_1; p_qword90a = (HDDMTileType **)this->p_qword90; p_char258_2 = operator new(0x30u); p_char258_1 = (HDDMTileType **)p_char258_2; if ( p_char258_2 ) { *(_DWORD *)p_char258_2 = 0; *(_QWORD *)(p_char258_2 + 8) = 0; *(_QWORD *)(p_char258_2 + 16) = 0; *(_QWORD *)(p_char258_2 + 24) = 0; *(_QWORD *)(p_char258_2 + 32) = v117[0]; v117[0] = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(p_char258_2 + 40) = 0; } insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_ = std::_Rb_tree<std::string,std::pair<std::string const,HDDMTileType *>,std::_Select1st<std::pair<std::string const,HDDMTileType *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMTileType *>>>::_M_get_insert_hint_unique_pos( p_qword90a, p_qword60, p_char258_2 + 32); if ( p_qword90a_1 ) { v63 = 1; if ( !insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_ && p_char258 != (char *)p_qword90a_1 ) { p_qword90a = p_qword90a_1; v71 = std::string::compare((std::string *)(p_char258_1 + 4), (const std::string *)(p_qword90a_1 + 4)); p_qword90a_1 = p_qword90a; v63 = v71 >> 31; } std::_Rb_tree_insert_and_rebalance(v63, p_char258_1, p_qword90a_1, &this->char258); ++this->qword278; } else { p_qword90a = (HDDMTileType **)insert_hint_unique_posESt23_Rb_tree_const_iteratorIS4_ERS1_; std::string::_Rep::_M_dispose((char *)p_char258_1[4] - 24, v95); operator delete(p_char258_1); p_char258_1 = p_qword90a; } } ++v53; p_char258_1[5] = v119[0]; std::string::_Rep::_M_dispose(v117[0] - 24LL, v95); } while ( v85 != v53 ); } std::_Rb_tree<std::string,std::string,std::_Identity<std::string>,std::less<std::string>,std::allocator<std::string>>::_M_erase( p_s2, v122); HUTMemWatcher::~HUTMemWatcher(v93); std::string::string(v94, "", v117); std::string::string(v95, "device::ArchXngFlags", v100); HUTMemWatcher::HUTMemWatcher(v93, v95, v94); std::string::_Rep::_M_dispose(v118[0] - 24LL, p_s2); std::string::_Rep::_M_dispose((char *)v119[0] - 24, p_s2); this->byte1F3 = v138 & 1; this->byte1F3 &= 1u; HUTMemWatcher::~HUTMemWatcher(v93); HDDMXng::Architecture::~Architecture(v105); sub_1F34A70(v102); HUTMemWatcher::~HUTMemWatcher(v106); } void __fastcall HDDMDevice::writearch_pb(HDDMDevice *this, std::ostream *stream, unsigned __int16 fileVersion) { std::string *v5; // rdi const std::string *qword1E0; // r14 const std::string *v7; // rbp const google::protobuf::Message *v8; // rdx __int64 v9; // rax std::string *v10; // rax __int64 v11; // rdx std::string *v12; // rdi __int64 v13; // rax google::protobuf::internal::StringTypeHandlerBase *v14; // rdi int v15; // esi const std::string *qword50; // r14 const std::string *i; // rbp std::string *v18; // rax __int64 v19; // rdx std::string *v20; // rdi __int64 v21; // rax google::protobuf::internal::StringTypeHandlerBase *v22; // rdi int v23; // esi const std::string *qword68; // r14 const std::string *j; // rbp std::string *v26; // rax __int64 v27; // rdx std::string *v28; // rdi __int64 v29; // rax google::protobuf::internal::StringTypeHandlerBase *v30; // rdi int v31; // esi int byte1F3; // eax _QWORD *hddmBelDefVec_End; // rbp _QWORD *k; // rbx HDDMSiteType **qword98; // rbp HDDMSiteType **m; // rbx _QWORD *qwordB0; // rbp _QWORD *n; // rbx __int64 v40; // rax __int64 v41; // rax __int64 v42; // rax __int64 v43; // rax __int64 v44; // rbp __int64 v45; // rax __int64 v46; // rax __int64 v47; // rax char v49; // [rsp+2Bh] [rbp-12Dh] BYREF char v50[2]; // [rsp+2Ch] [rbp-12Ch] BYREF char v51[2]; // [rsp+2Eh] [rbp-12Ah] BYREF _QWORD v52[2]; // [rsp+30h] [rbp-128h] BYREF _BYTE v53[16]; // [rsp+40h] [rbp-118h] BYREF std::string *v54; // [rsp+50h] [rbp-108h] __int64 v55; // [rsp+58h] [rbp-100h] BYREF int v56; // [rsp+60h] [rbp-F8h] int v57; // [rsp+64h] [rbp-F4h] int v58; // [rsp+68h] [rbp-F0h] __int64 v59; // [rsp+90h] [rbp-C8h] BYREF int v60; // [rsp+98h] [rbp-C0h] int v61; // [rsp+9Ch] [rbp-BCh] int v62; // [rsp+A0h] [rbp-B8h] __int64 v63; // [rsp+C8h] [rbp-90h] BYREF int v64; // [rsp+D0h] [rbp-88h] int v65; // [rsp+D4h] [rbp-84h] int v66; // [rsp+D8h] [rbp-80h] int word28; // [rsp+100h] [rbp-58h] int v68; // [rsp+104h] [rbp-54h] int v69; // [rsp+108h] [rbp-50h] int v70; // [rsp+10Ch] [rbp-4Ch] int v71; // [rsp+110h] [rbp-48h] unsigned int v72; // [rsp+118h] [rbp-40h] if ( fileVersion > 2u ) { v40 = std::endl<char,std::char_traits<char>>(&std::cerr); v41 = std::operator<<<std::char_traits<char>>(v40, "ERROR:"); v42 = std::operator<<<std::char_traits<char>>( v41, "/proj/rdi-xco/wall/workspaces/wall287/sub/REL/2016.3/src/shared/device/devmodel/HDDMDevice.cxx"); v43 = std::operator<<<std::char_traits<char>>(v42, ":"); v44 = std::ostream::operator<<(v43, 3325LL); std::__ostream_insert<char,std::char_traits<char>>(v44, ": ", 2LL); v45 = std::operator<<<std::char_traits<char>>(v44, "Invalid version number "); v46 = std::ostream::_M_insert<unsigned long>(v45, fileVersion); v47 = std::operator<<<std::char_traits<char>>(v46, ", expected 0, 1 or 2."); std::endl<char,std::char_traits<char>>(v47); } else { std::ostream::write(stream, "xnga", 4LL); *(_WORD *)v51 = 0; *(_WORD *)v50 = fileVersion | 0x8000; std::ostream::write(stream, v50, 2LL); std::ostream::write(stream, v51, 2LL); HDDMXng::Architecture::Architecture((HDDMXng::Architecture *)v53); v72 |= 1u; v5 = v54; if ( v54 == (std::string *)&google::protobuf::internal::kEmptyString ) { v5 = (std::string *)operator new(8uLL); *(_QWORD *)v5 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; v54 = v5; } std::string::assign(v5, (const std::string *)&this->qword30); v8 = (const google::protobuf::Message *)v72; qword1E0 = (const std::string *)this->qword1E0; v7 = *(const std::string **)&this->char1D8; LOBYTE(v8) = v72 | 0xF0; word28 = (unsigned __int16)this->word28; v9 = this->hddmBelDefVec_End - this->hddmBelDefVec; v72 = (unsigned int)v8; v68 = v9 >> 3; v69 = (__int64)(this->qword98 - this->qword90) >> 3; v70 = (__int64)(this->qwordB0 - this->qwordA8) >> 3; while ( qword1E0 != v7 ) { v14 = (google::protobuf::internal::StringTypeHandlerBase *)v52; std::string::string((std::string *)v52, v7); v13 = v56; v15 = v57; if ( v56 >= v57 ) { if ( v57 == v58 ) { v14 = (google::protobuf::internal::StringTypeHandlerBase *)&v55; google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v55, v57 + 1); v15 = v57; } v57 = v15 + 1; v10 = (std::string *)google::protobuf::internal::StringTypeHandlerBase::New(v14); v11 = v56; v12 = v10; ++v56; *(_QWORD *)(v55 + 8 * v11) = v10; } else { ++v56; v12 = *(std::string **)(v55 + 8 * v13); } std::string::assign(v12, (const std::string *)v52); v7 = (const std::string *)((char *)v7 + 8); std::string::_Rep::_M_dispose(v52[0] - 24LL, &v49); } qword50 = (const std::string *)this->qword50; for ( i = (const std::string *)this->char48; qword50 != i; i = (const std::string *)((char *)i + 8) ) { v22 = (google::protobuf::internal::StringTypeHandlerBase *)v52; std::string::string((std::string *)v52, i); v21 = v60; v23 = v61; if ( v60 >= v61 ) { if ( v61 == v62 ) { v22 = (google::protobuf::internal::StringTypeHandlerBase *)&v59; google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v59, v61 + 1); v23 = v61; } v61 = v23 + 1; v18 = (std::string *)google::protobuf::internal::StringTypeHandlerBase::New(v22); v19 = v60; v20 = v18; ++v60; *(_QWORD *)(v59 + 8 * v19) = v18; } else { ++v60; v20 = *(std::string **)(v59 + 8 * v21); } std::string::assign(v20, (const std::string *)v52); std::string::_Rep::_M_dispose(v52[0] - 24LL, &v49); } qword68 = (const std::string *)this->qword68; for ( j = (const std::string *)this->qword60; qword68 != j; j = (const std::string *)((char *)j + 8) ) { v30 = (google::protobuf::internal::StringTypeHandlerBase *)v52; std::string::string((std::string *)v52, j); v29 = v64; v31 = v65; if ( v64 >= v65 ) { if ( v65 == v66 ) { v30 = (google::protobuf::internal::StringTypeHandlerBase *)&v63; google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v63, v65 + 1); v31 = v65; } v65 = v31 + 1; v26 = (std::string *)google::protobuf::internal::StringTypeHandlerBase::New(v30); v27 = v64; v28 = v26; ++v64; *(_QWORD *)(v63 + 8 * v27) = v26; } else { ++v64; v28 = *(std::string **)(v63 + 8 * v29); } std::string::assign(v28, (const std::string *)v52); std::string::_Rep::_M_dispose(v52[0] - 24LL, &v49); } byte1F3 = (unsigned __int8)this->byte1F3; v72 |= 0x100u; v71 = byte1F3; HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v53, v8); hddmBelDefVec_End = (_QWORD *)this->hddmBelDefVec_End; for ( k = (_QWORD *)this->hddmBelDefVec; hddmBelDefVec_End != k; ++k ) (*(void (__fastcall **)(_QWORD, std::ostream *, _QWORD))(*(_QWORD *)*k + 24LL))(*k, stream, fileVersion); qword98 = (HDDMSiteType **)this->qword98; for ( m = (HDDMSiteType **)this->qword90; qword98 != m; ++m ) HDDMSiteType::writeme_pb(*m, stream); qwordB0 = (_QWORD *)this->qwordB0; for ( n = (_QWORD *)this->qwordA8; qwordB0 != n; ++n ) HDDMTileType::writeme_pb(*n, stream, fileVersion); std::ostream::flush(stream); HDDMXng::Architecture::~Architecture((HDDMXng::Architecture *)v53); } }
10-27
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持原始函数定义不变,不要拆分函数 2.保持所有原始逻辑功能不变 3.结构体采用32位定义 4.严格保持protobuf字段映射关系 5.提高执行效率,降低计算复杂度 6.已经给定的结构体名字和元素不要更改,详细的中文注释 7.自动添加中文注释说明功能逻辑 8.不使用 auto,使用显式 for 循环 特别注意: 1.函数中的 HDDMXng::BelDef::BelDef 映射为 message BelDef { optional bool optinv = 1; optional bool rbel = 2; optional string belname = 3; optional uint32 numoutputpins = 4; optional uint32 numinputpins = 5; optional uint32 numpins = 6; optional uint32 numsrcs = 7; optional uint32 numprims = 8; repeated uint32 srcgnds = 9 [packed = true]; repeated BelDefPip pips = 10; optional bool hasusagedef = 11; } 其中,依赖消息有: message AttrSetting { optional string attrname = 1; optional string attrvalue = 2; } message BelDefPip { optional uint32 pin1 = 1; optional uint32 pin2 = 2; repeated AttrSetting attrsettings = 3; } 2.将函数中 _BYTE beldef_msg[16] 映射为 HDDMXng::BelDef beldef_msg void __fastcall HDDMBelDef::HDDMBelDef(HDDMBelDef *this) { int v1; // eax unsigned int v2; // eax this->beldef_code &= 0xC000u; this->beldef_code1 &= 0xF0u; *(_DWORD *)&this->char40 = 0; this->qword48 = 0; this->qword60 = 0; this->hddmPrimitive = 0; this->qword0 = qword0; v1 = *(_DWORD *)&this->beldef_code; this->qword30 = 0; this->qword20 = 0; this->hddmBelPinDefArray = 0; this->hddmBelUsageDef = 0; v1 &= 0xF0003FFF; *(_DWORD *)&this->beldef_code = v1; this->? = HIBYTE(v1) & 0xCF; v2 = *(_DWORD *)&this->beldef_code1 & 0xFFFC000F; *(_DWORD *)&this->beldef_code1 = v2; this->? = HIWORD(v2) | 0x3FFC; this->belDef_name = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; this->qword50 = &this->char40; this->qword58 = &this->char40; } void __fastcall HDDMBelDef::~HDDMBelDef(HDDMBelDef *this) { HDDMPrimitive *hddmPrimitive; // rbp _QWORD *vtable; // rbx _QWORD *vtable_2; // rax void *vtable_1; // rdi _QWORD *qword20; // rsi unsigned __int16 v7; // ax __int64 v8; // rbx void *v9; // rdi HDDMBelPinDef *hddmBelPinDefArray_1; // rdi HDDMBelPinDef *hddmBelPinDefArray_3; // rbx HDDMBelPinDef *v12; // rbx HDDMBelPinDef *v13; // rdi HDDMBelPinDef *hddmBelPinDefArray_2; // rbp _QWORD *qword30; // rbx HDDMBelUsageDef *hddmBelUsageDef; // rbx HDDMBelDef *i; // r14 HDDMBelPinDef *hddmBelPinDefArray; // r13 char *pindef_name; // r8 char *v20; // r15 char *pindef_name_4; // rbx _QWORD *v22; // r9 __int64 v23; // rdx void *p__ZNSs4_Rep20_S_empty_rep_storageE; // rdi void *pindef_name_1; // rdi __int64 v26; // rdx __int64 v27; // rdx void *p__ZNSs4_Rep20_S_empty_rep_storageE_1; // rdi int v29; // ecx int v30; // ecx char *pindef_name_3; // [rsp+10h] [rbp-58h] char *pindef_name_2; // [rsp+10h] [rbp-58h] char *pindef_name_5; // [rsp+10h] [rbp-58h] char *pindef_name_6; // [rsp+10h] [rbp-58h] _QWORD *v35; // [rsp+18h] [rbp-50h] _QWORD *v36; // [rsp+18h] [rbp-50h] _QWORD *v37; // [rsp+18h] [rbp-50h] _QWORD *v38; // [rsp+18h] [rbp-50h] _BYTE v39[57]; // [rsp+2Fh] [rbp-39h] BYREF hddmPrimitive = this->hddmPrimitive; this->qword0 = qword0; if ( hddmPrimitive ) { vtable = (_QWORD *)hddmPrimitive->vtable; vtable_2 = *(_QWORD **)&hddmPrimitive->numPrimType; if ( (_QWORD *)hddmPrimitive->vtable == vtable_2 ) { vtable_1 = (void *)hddmPrimitive->vtable; } else { do { if ( *vtable ) { (*(void (__fastcall **)(_QWORD))(*(_QWORD *)*vtable + 24LL))(*vtable); hddmPrimitive = this->hddmPrimitive; vtable_2 = *(_QWORD **)&hddmPrimitive->numPrimType; } ++vtable; } while ( vtable != vtable_2 ); vtable_1 = (void *)hddmPrimitive->vtable; } if ( vtable_1 ) operator delete(vtable_1); operator delete(hddmPrimitive); this->hddmPrimitive = 0; } qword20 = (_QWORD *)this->qword20; if ( qword20 ) { v7 = (this->beldef_code >> 14) & 0x3FFF; if ( !v7 ) goto LABEL_17; v8 = 0; do { v9 = (void *)qword20[v8]; if ( v9 ) { operator delete[](v9); *(_QWORD *)(this->qword20 + 8 * v8) = 0; qword20 = (_QWORD *)this->qword20; v7 = (this->beldef_code >> 14) & 0x3FFF; } ++v8; } while ( v7 > (int)v8 ); if ( qword20 ) LABEL_17: operator delete[](qword20); this->qword20 = 0; } if ( this->qword60 ) { for ( i = (HDDMBelDef *)this->qword50; i != (HDDMBelDef *)&this->char40; i = (HDDMBelDef *)std::_Rb_tree_increment(i) ) { hddmBelPinDefArray = i->hddmBelPinDefArray; if ( hddmBelPinDefArray ) { pindef_name = (char *)hddmBelPinDefArray->pindef_name; v20 = *(char **)&hddmBelPinDefArray->pindef_code; if ( pindef_name == *(char **)&hddmBelPinDefArray->pindef_code ) { pindef_name_1 = (void *)hddmBelPinDefArray->pindef_name; } else { pindef_name_4 = *(char **)&hddmBelPinDefArray->pindef_code; v22 = v20 + 8; if ( &_pthread_key_create ) { do { v23 = *(_QWORD *)((char *)v22 + pindef_name_4 - v20); if ( (_UNKNOWN *)(v23 - 24) != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(v23 - 8), 0xFFFFFFFF) <= 0 ) { v36 = v22; pindef_name_2 = pindef_name; std::string::_Rep::_M_destroy(v23 - 24, v39); v22 = v36; pindef_name = pindef_name_2; } p__ZNSs4_Rep20_S_empty_rep_storageE = (void *)(*(_QWORD *)pindef_name_4 - 24LL); if ( p__ZNSs4_Rep20_S_empty_rep_storageE != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(*(_QWORD *)pindef_name_4 - 8LL), 0xFFFFFFFF) <= 0 ) { v35 = v22; pindef_name_3 = pindef_name; std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE, v39); v22 = v35; pindef_name = pindef_name_3; } pindef_name_4 += 16; } while ( pindef_name != pindef_name_4 ); } else { do { v26 = *(_QWORD *)((char *)v22 + pindef_name_4 - v20); if ( (_UNKNOWN *)(v26 - 24) != &std::string::_Rep::_S_empty_rep_storage ) { v29 = *(_DWORD *)(v26 - 8); *(_DWORD *)(v26 - 8) = v29 - 1; if ( v29 <= 0 ) { v37 = v22; pindef_name_5 = pindef_name; std::string::_Rep::_M_destroy(v26 - 24, v39); v22 = v37; pindef_name = pindef_name_5; } } v27 = *(_QWORD *)pindef_name_4; p__ZNSs4_Rep20_S_empty_rep_storageE_1 = (void *)(*(_QWORD *)pindef_name_4 - 24LL); if ( p__ZNSs4_Rep20_S_empty_rep_storageE_1 != &std::string::_Rep::_S_empty_rep_storage ) { v30 = *(_DWORD *)(v27 - 8); *(_DWORD *)(v27 - 8) = v30 - 1; if ( v30 <= 0 ) { v38 = v22; pindef_name_6 = pindef_name; std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE_1, v39); v22 = v38; pindef_name = pindef_name_6; } } pindef_name_4 += 16; } while ( pindef_name != pindef_name_4 ); } pindef_name_1 = *(void **)&hddmBelPinDefArray->pindef_code; } if ( pindef_name_1 ) operator delete(pindef_name_1); operator delete(hddmBelPinDefArray); } } } hddmBelPinDefArray_1 = this->hddmBelPinDefArray; if ( hddmBelPinDefArray_1 ) { hddmBelPinDefArray_3 = &hddmBelPinDefArray_1[hddmBelPinDefArray_1[-1].pindef_name]; if ( hddmBelPinDefArray_1 != hddmBelPinDefArray_3 ) { v12 = hddmBelPinDefArray_3 - 1; do { v13 = v12; hddmBelPinDefArray_2 = v12--; HDDMBelPinDef::~HDDMBelPinDef(v13); hddmBelPinDefArray_1 = this->hddmBelPinDefArray; } while ( hddmBelPinDefArray_1 != hddmBelPinDefArray_2 ); } operator delete[](&hddmBelPinDefArray_1[-1].pindef_name); this->hddmBelPinDefArray = 0; } qword30 = (_QWORD *)this->qword30; if ( qword30 ) { std::_Rb_tree<std::string,std::pair<std::string const,HDDMBelPinDef *>,std::_Select1st<std::pair<std::string const,HDDMBelPinDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMBelPinDef *>>>::_M_erase( this->qword30, qword30[2]); operator delete(qword30); this->qword30 = 0; } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) { HDDMBelUsageDef::~HDDMBelUsageDef(this->hddmBelUsageDef); operator delete(hddmBelUsageDef); } this->hddmBelUsageDef = 0; sub_21726B0(this); std::_Rb_tree<std::pair<unsigned short,unsigned short>,std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>,std::_Select1st<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>,std::less<std::pair<unsigned short,unsigned short>>,std::allocator<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>>::_M_erase( &this->field_38, this->qword48); std::string::_Rep::_M_dispose((char *)this->belDef_name - 24, v39); } void __fastcall HDDMBelDef::readme_pb(HDDMBelDef *this, std::istream *stream, HDDMDevice *hddmDevice) { google::protobuf::Message *v3; // rdx char **p_belDef_name; // rbx char byteB; // al bool v6; // zf unsigned __int16 v7; // r14 _QWORD *v8; // rax __int64 v9; // rbx HDDMBelPinDef *hddmBelPinDefArray; // r12 HDDMBelPinDef *v11; // rbp __int64 index; // rbx HDDMBelPinDef *hddmBelPinDef; // r12 int v14; // r13d unsigned __int16 v15; // ax int v16; // ebx int v17; // ebp __int64 qword20_1; // rax __int64 qword20; // r12 __int64 v20; // r13 __int64 v21; // rbx __int64 v22; // rax __int64 v23; // r12 int v24; // ebp unsigned __int64 v25; // rbx _QWORD *v26; // r13 _QWORD *v27; // rax int v28; // ebp __int64 qword48; // rdx char *p_char40_1; // rbx __int64 insert_hint_unique_pos; // rax __int64 p_char40_3; // rdx __int64 v33; // rdi unsigned __int64 v34; // rbx __int64 v35; // rbp __int64 v36; // rdi __int64 v37; // rdi __int64 v38; // rax const std::string *v39; // rbp unsigned __int16 v40; // ax _QWORD *qword18_1; // rbx unsigned __int64 n; // rbp char *s; // rax unsigned __int64 v44; // rbx const char *v45; // rcx __int64 v46; // rbp void (__fastcall **v47)(__int64, std::istream *, HDDMDevice *); // rax _QWORD *qword18; // rax int v49; // eax int v50; // eax std::string *belDef_name; // rax std::string *qword10_1; // rsi std::string *qword10_2; // rdx const char *OPTFF; // rcx std::string *qword10_3; // rax char v56; // di std::string *qword10_4; // rdx char *v58; // rcx std::string *qword10_5; // rax char v60; // di int v61; // edx int v62; // edx __int64 v64; // [rsp+8h] [rbp-140h] int v65; // [rsp+14h] [rbp-134h] int v66; // [rsp+18h] [rbp-130h] char *insert_hint_unique_pos_1; // [rsp+18h] [rbp-130h] char *p_char40_2; // [rsp+30h] [rbp-118h] char *p_char40; // [rsp+38h] [rbp-110h] char v72; // [rsp+5Fh] [rbp-E9h] BYREF char v73[8]; // [rsp+60h] [rbp-E8h] BYREF __int64 v74; // [rsp+68h] [rbp-E0h] BYREF _BYTE beldef_msg[16]; // [rsp+70h] [rbp-D8h] BYREF std::string *v76; // [rsp+80h] [rbp-C8h] __int16 v77; // [rsp+88h] [rbp-C0h] char v78; // [rsp+8Ch] [rbp-BCh] char v79; // [rsp+8Dh] [rbp-BBh] char v80; // [rsp+8Eh] [rbp-BAh] __int16 v81; // [rsp+90h] [rbp-B8h] __int16 v82; // [rsp+94h] [rbp-B4h] int v83; // [rsp+9Ch] [rbp-ACh] __int64 v84; // [rsp+C8h] [rbp-80h] int v85; // [rsp+D0h] [rbp-78h] char v86; // [rsp+104h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 6); HDDMXng::BelDef::BelDef((HDDMXng::BelDef *)beldef_msg); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)beldef_msg, v3); p_belDef_name = (char **)&this->belDef_name; byteB = (16 * (v78 & 1)) | HIBYTE(this->beldef_code) & 0xEF; HIBYTE(this->beldef_code) = byteB; HIBYTE(this->beldef_code) = (32 * (v79 & 1)) | byteB & 0xDF; std::string::assign((std::string *)&this->belDef_name, v76); if ( (this->beldef_code & 0x30000000) != 0 ) goto LABEL_4; if ( sub_21655B0(p_belDef_name, "IDDR") || sub_21655B0(p_belDef_name, "IPFF") || sub_21655B0(p_belDef_name, "OPFF") ) goto LABEL_67; belDef_name = this->belDef_name; qword10_1 = (std::string *)((char *)belDef_name + *((_QWORD *)belDef_name - 3)); if ( belDef_name == qword10_1 ) goto LABEL_4; if ( *(_BYTE *)belDef_name == 79 ) { qword10_2 = (std::string *)((char *)belDef_name + 1); OPTFF = "OPTFF"; qword10_3 = (std::string *)((char *)belDef_name + 5); while ( 1 ) { ++OPTFF; if ( qword10_2 == qword10_1 ) break; if ( qword10_2 == qword10_3 ) goto LABEL_67; v56 = *(_BYTE *)qword10_2; qword10_2 = (std::string *)((char *)qword10_2 + 1); if ( v56 != *OPTFF ) goto LABEL_4; } if ( OPTFF != "" ) goto LABEL_4; LABEL_67: HIBYTE(this->beldef_code) |= 0x10u; goto LABEL_4; } if ( *(_BYTE *)belDef_name == 84 ) { qword10_4 = (std::string *)((char *)belDef_name + 1); v58 = "TFF"; qword10_5 = (std::string *)((char *)belDef_name + 3); while ( 1 ) { ++v58; if ( qword10_4 == qword10_1 ) break; if ( qword10_4 == qword10_5 ) goto LABEL_67; v60 = *(_BYTE *)qword10_4; qword10_4 = (std::string *)((char *)qword10_4 + 1); if ( v60 != *v58 ) goto LABEL_4; } if ( v58 == "" ) goto LABEL_67; } LABEL_4: this->beldef_code = ((v81 & 0x3FFF) << 14) | this->beldef_code & 0xF0003FFF; this->beldef_code1 = (16 * (v77 & 0x3FFF)) | this->beldef_code1 & 0xFFFC000F; v6 = HDDMDeviceDump::useXngMarks == 0; LOWORD(this->beldef_code) = v82 & 0x3FFF | this->beldef_code & 0xC000; if ( !v6 ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 4); v7 = this->beldef_code & 0x3FFF; if ( v7 ) { v8 = (_QWORD *)operator new[](16LL * v7 + 8); v9 = v7 - 1LL; hddmBelPinDefArray = (HDDMBelPinDef *)(v8 + 1); *v8 = v7; v11 = (HDDMBelPinDef *)(v8 + 1); do { HDDMBelPinDef::HDDMBelPinDef(v11); --v9; ++v11; } while ( v9 != -1 ); index = 0; v6 = (this->beldef_code & 0x3FFF) == 0; this->hddmBelPinDefArray = hddmBelPinDefArray; if ( !v6 ) { while ( 1 ) { hddmBelPinDef = &hddmBelPinDefArray[index]; HDDMBelPinDef::readme_pb(hddmBelPinDef, stream, hddmDevice); LOWORD(hddmBelPinDef->pindef_code1) = (16 * (HIWORD(this->beldef_code1) >> 2)) | hddmBelPinDef->pindef_code1 & 0xF; hddmBelPinDef->pindef_code = ((index++ & 0x3FFF) << 6) | hddmBelPinDef->pindef_code & 0xFFF0003F; if ( (this->beldef_code & 0x3FFF) <= (int)index ) break; hddmBelPinDefArray = this->hddmBelPinDefArray; } } HDDMBelDef::createpindefsmap(this); } if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 5); if ( v86 < 0 ) { v14 = v83; if ( v83 ) { qword18_1 = (_QWORD *)operator new(0x18u); *qword18_1 = 0; qword18_1[1] = 0; qword18_1[2] = 0; if ( (unsigned __int64)v14 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n = 8LL * v14; s = (char *)operator new(n); *qword18_1 = s; qword18_1[1] = s; qword18_1[2] = &s[n]; memset(s, 0, n); qword18_1[1] = qword18_1[2]; this->qword18 = qword18_1; if ( v14 > 0 ) { v44 = 0; do { std::istream::read(stream, v73, 2); HDDMDeviceDump::dumpbinary((HDDMDeviceDump *)v73, (const char *)&dword_0 + 2, (int)"beldef:", v45); v46 = HDDMPrimitive::create(*(unsigned __int16 *)v73); v47 = *(void (__fastcall ***)(__int64, std::istream *, HDDMDevice *))v46; *(_QWORD *)(v46 + 16) = this; (*v47)(v46, stream, hddmDevice); qword18 = (_QWORD *)this->qword18; if ( v44 >= (__int64)(qword18[1] - *qword18) >> 3 ) std::__throw_out_of_range("vector::_M_range_check"); *(_QWORD *)(*qword18 + 8 * v44++) = v46; } while ( v14 > (int)v44 ); } } } if ( v85 ) { v15 = (this->beldef_code & 0x3FFF) - (((this->beldef_code >> 14) & 0x3FFF) + ((this->beldef_code1 >> 4) & 0x3FFF)); v16 = ((this->beldef_code >> 14) & 0x3FFF) + v15; v17 = v15 + ((this->beldef_code1 >> 4) & 0x3FFF); qword20_1 = operator new[](8LL * v16); this->qword20 = qword20_1; if ( v16 ) { qword20 = qword20_1; v20 = 8LL * (unsigned int)(v16 - 1) + 8; v21 = 0; while ( 1 ) { *(_QWORD *)(v21 + qword20) = operator new[](v17); v22 = 0; if ( v17 ) { do *(_BYTE *)(*(_QWORD *)(this->qword20 + v21) + v22++) = 0; while ( v17 > (int)v22 ); } v21 += 8; if ( v21 == v20 ) break; qword20 = this->qword20; } } if ( v85 > 0 ) { v64 = 0; v65 = 0; p_char40_2 = (char *)&this->char40; do { v23 = *(_QWORD *)(v84 + v64); v24 = *(_DWORD *)(v23 + 20); v66 = *(_DWORD *)(v23 + 16); *(_BYTE *)(*(_QWORD *)(this->qword20 + 8LL * v66) + v24) = 1; v25 = *(int *)(v23 + 32); if ( (_DWORD)v25 ) { v26 = (_QWORD *)operator new(0x18u); *v26 = 0; v26[1] = 0; v26[2] = 0; if ( v25 > 0xFFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v27 = (_QWORD *)operator new(16 * v25); *v26 = v27; v26[1] = v27; v26[2] = &v27[2 * v25]; do { if ( v27 ) { *v27 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; v27[1] = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; } v27 += 2; --v25; } while ( v25 ); v26[1] = v26[2]; v28 = ((this->beldef_code >> 14) & 0x3FFF) + (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code1 >> 4) & 0x3FFF) + ((this->beldef_code >> 14) & 0x3FFF))) + v24; qword48 = this->qword48; p_char40_1 = (char *)&this->char40; if ( !qword48 ) goto LABEL_45; do { while ( (unsigned __int16)v66 <= *(_WORD *)(qword48 + 32) && ((unsigned __int16)v66 < *(_WORD *)(qword48 + 32) || (unsigned __int16)v28 <= *(_WORD *)(qword48 + 34)) ) { p_char40_1 = (char *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_41; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_41: if ( p_char40_2 == p_char40_1 || (unsigned __int16)v66 < *((_WORD *)p_char40_1 + 16) || (unsigned __int16)v66 <= *((_WORD *)p_char40_1 + 16) && (unsigned __int16)v28 < *((_WORD *)p_char40_1 + 17) ) { LABEL_45: p_char40 = p_char40_1; p_char40_1 = (char *)operator new(0x30u); if ( p_char40_1 ) { *(_DWORD *)p_char40_1 = 0; *((_QWORD *)p_char40_1 + 1) = 0; *((_QWORD *)p_char40_1 + 2) = 0; *((_QWORD *)p_char40_1 + 3) = 0; *((_WORD *)p_char40_1 + 17) = v28; *((_QWORD *)p_char40_1 + 5) = 0; *((_WORD *)p_char40_1 + 16) = v66; } insert_hint_unique_pos = std::_Rb_tree<std::pair<unsigned short,unsigned short>,std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>,std::_Select1st<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>,std::less<std::pair<unsigned short,unsigned short>>,std::allocator<std::pair<std::pair<unsigned short,unsigned short> const,std::vector<std::pair<std::string,std::string>> *>>>::_M_get_insert_hint_unique_pos( &this->field_38, p_char40, p_char40_1 + 32); if ( p_char40_3 ) { v33 = 1; if ( !insert_hint_unique_pos && p_char40_2 != (char *)p_char40_3 ) { v40 = *(_WORD *)(p_char40_3 + 32); if ( *((_WORD *)p_char40_1 + 16) >= v40 && (*((_WORD *)p_char40_1 + 16) > v40 || *((_WORD *)p_char40_1 + 17) >= *(_WORD *)(p_char40_3 + 34)) ) { v33 = 0; } } std::_Rb_tree_insert_and_rebalance(v33, p_char40_1, p_char40_3, p_char40_2); ++this->qword60; } else { insert_hint_unique_pos_1 = (char *)insert_hint_unique_pos; operator delete(p_char40_1); p_char40_1 = insert_hint_unique_pos_1; } } *((_QWORD *)p_char40_1 + 5) = v26; if ( *(int *)(v23 + 32) > 0 ) { v34 = 0; do { v38 = *(_QWORD *)(*(_QWORD *)(v23 + 24) + 8 * v34); v39 = *(const std::string **)(v38 + 24); std::string::string((std::string *)v73, *(const std::string **)(v38 + 16)); std::string::string((std::string *)&v74, v39); if ( v34 >= (__int64)(v26[1] - *v26) >> 4 ) std::__throw_out_of_range("vector::_M_range_check"); v35 = *v26 + 16 * v34; std::string::swap((std::string *)v35, (std::string *)v73); std::string::swap((std::string *)(v35 + 8), (std::string *)&v74); v36 = v74 - 24; if ( (_UNKNOWN *)(v74 - 24) != &std::string::_Rep::_S_empty_rep_storage ) { if ( &_pthread_key_create ) { v50 = _InterlockedExchangeAdd((volatile signed __int32 *)(v74 - 8), 0xFFFFFFFF); } else { v61 = *(_DWORD *)(v74 - 8); *(_DWORD *)(v74 - 8) = v61 - 1; v50 = v61; } if ( v50 <= 0 ) std::string::_Rep::_M_destroy(v36, &v72); } v37 = *(_QWORD *)v73 - 24LL; if ( (_UNKNOWN *)(*(_QWORD *)v73 - 24LL) != &std::string::_Rep::_S_empty_rep_storage ) { if ( &_pthread_key_create ) { v49 = _InterlockedExchangeAdd((volatile signed __int32 *)(*(_QWORD *)v73 - 8LL), 0xFFFFFFFF); } else { v62 = *(_DWORD *)(*(_QWORD *)v73 - 8LL); *(_DWORD *)(*(_QWORD *)v73 - 8LL) = v62 - 1; v49 = v62; } if ( v49 <= 0 ) std::string::_Rep::_M_destroy(v37, &v72); } ++v34; } while ( *(_DWORD *)(v23 + 32) > (int)v34 ); } } ++v65; v64 += 8; } while ( v65 < v85 ); } } if ( v80 ) { HDDMBelDef::addusagedef(this); HDDMBelUsageDef::readme_pb(this->hddmBelUsageDef, stream, hddmDevice); HDDMBelUsageDef::setrecursivebelid(this->hddmBelUsageDef, (HIWORD(this->beldef_code1) >> 2) & 0xFFF); } HDDMXng::BelDef::~BelDef((HDDMXng::BelDef *)beldef_msg); } void __fastcall HDDMBelDef::writeme_pb(HDDMBelDef *this, std::ostream *stream) { char beldef_code_high; // dl int v3; // eax std::string *p__ZN6google8protobuf8internal12kEmptyStringE_3; // rdi HDDMBelDef *HDDMBelDef_1; // rax unsigned int beldef_code; // ecx unsigned int beldef_code1; // edx __int16 beldef_code_1; // ax int v9; // eax __int64 v10; // rdx int v11; // eax _DWORD *v12; // rbp __int64 v13; // rax int v14; // eax unsigned __int16 v15; // cx __int64 qword48; // rax _QWORD *p_char40; // rdx __int64 *v18; // r12 unsigned __int64 v19; // r14 unsigned __int64 i; // r13 __int64 v21; // rbx __int64 v22; // rax __int64 v23; // rdx __int64 v24; // r15 std::string *p__ZN6google8protobuf8internal12kEmptyStringE_1; // rdi const std::string *v26; // r15 __int64 v27; // rdx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_2; // rdi const std::string *v29; // r13 __int64 v30; // rax __int64 v31; // rdx int v32; // esi HDDMBelDef *HDDMBelDef_2; // rax const google::protobuf::Message *qword18; // rdx __int64 v35; // rax __int64 v36; // rbx __int64 *qword18_1; // rdx __int64 v38; // rax __int64 v39; // rdx __int64 v40; // rbx __int64 v41; // r13 _DWORD *v42; // rbp const char *v43; // rcx HDDMBelUsageDef *hddmBelUsageDef; // rdi __int64 v45; // [rsp+8h] [rbp-140h] int v47; // [rsp+2Ch] [rbp-11Ch] __int64 v48; // [rsp+38h] [rbp-110h] int v49; // [rsp+44h] [rbp-104h] char v51[16]; // [rsp+60h] [rbp-E8h] BYREF _BYTE v52[16]; // [rsp+70h] [rbp-D8h] BYREF std::string *p__ZN6google8protobuf8internal12kEmptyStringE; // [rsp+80h] [rbp-C8h] int v54; // [rsp+88h] [rbp-C0h] char v55; // [rsp+8Ch] [rbp-BCh] char v56; // [rsp+8Dh] [rbp-BBh] char v57; // [rsp+8Eh] [rbp-BAh] int v58; // [rsp+90h] [rbp-B8h] int v59; // [rsp+94h] [rbp-B4h] int v60; // [rsp+9Ch] [rbp-ACh] __int64 v61; // [rsp+C8h] [rbp-80h] BYREF int v62; // [rsp+D0h] [rbp-78h] int v63; // [rsp+D4h] [rbp-74h] int v64; // [rsp+D8h] [rbp-70h] int v65; // [rsp+104h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "BELDEF", 6); HDDMXng::BelDef::BelDef((HDDMXng::BelDef *)v52); beldef_code_high = HIBYTE(this->beldef_code); v3 = v65; if ( (beldef_code_high & 0x20) != 0 ) { v56 = 1; v3 = v65 | 2; } if ( (beldef_code_high & 0x10) != 0 ) { v55 = 1; v3 |= 1u; } p__ZN6google8protobuf8internal12kEmptyStringE_3 = p__ZN6google8protobuf8internal12kEmptyStringE; v65 = v3 | 4; if ( p__ZN6google8protobuf8internal12kEmptyStringE == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_3 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_3 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE = p__ZN6google8protobuf8internal12kEmptyStringE_3; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_3, (const std::string *)&this->belDef_name); HDDMBelDef_1 = this; beldef_code = this->beldef_code; if ( (beldef_code & 0xFFFC000) != 0 ) { v65 |= 0x10u; v58 = (beldef_code >> 14) & 0x3FFF; HDDMBelDef_1 = this; } beldef_code1 = HDDMBelDef_1->beldef_code1; if ( (beldef_code1 & 0x3FFF0) != 0 ) { v65 |= 8u; v54 = (beldef_code1 >> 4) & 0x3FFF; HDDMBelDef_1 = this; } beldef_code_1 = HDDMBelDef_1->beldef_code; if ( (beldef_code_1 & 0x3FFF) != 0 ) { v65 |= 0x20u; v59 = beldef_code_1 & 0x3FFF; } if ( this->qword20 ) { v9 = (unsigned __int16)((beldef_code_1 & 0x3FFF) - (((beldef_code >> 14) & 0x3FFF) + ((beldef_code1 >> 4) & 0x3FFF))); v47 = v9 + ((beldef_code1 >> 4) & 0x3FFF); v49 = v9 + ((beldef_code >> 14) & 0x3FFF); if ( v49 ) { v48 = 0; do { if ( v47 ) { v45 = 0; do { if ( *(_BYTE *)(*(_QWORD *)(this->qword20 + 8 * v48) + v45) ) { v10 = v62; v11 = v63; if ( v62 < v63 ) { ++v62; v12 = *(_DWORD **)(v61 + 8 * v10); } else { if ( v63 == v64 ) { google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v61, v63 + 1); v11 = v63; } v63 = v11 + 1; v12 = (_DWORD *)operator new(0x58u); HDDMXng::BelDefPip::BelDefPip((HDDMXng::BelDefPip *)v12); v13 = v62++; *(_QWORD *)(v61 + 8 * v13) = v12; } v14 = v12[21] | 3; v12[4] = v48; v12[21] = v14; v12[5] = v45; v15 = v49 + v45; qword48 = this->qword48; if ( qword48 ) { p_char40 = &this->char40; do { while ( (unsigned __int16)v48 <= *(_WORD *)(qword48 + 32) && ((unsigned __int16)v48 < *(_WORD *)(qword48 + 32) || *(_WORD *)(qword48 + 34) >= v15) ) { p_char40 = (_QWORD *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_33; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_33: if ( &this->char40 != p_char40 && (unsigned __int16)v48 >= *((_WORD *)p_char40 + 16) && ((unsigned __int16)v48 > *((_WORD *)p_char40 + 16) || *((_WORD *)p_char40 + 17) <= v15) ) { v18 = (__int64 *)p_char40[5]; if ( (v18[1] - *v18) >> 4 ) { v19 = 1; for ( i = 0; ; i = v19++ ) { v30 = (int)v12[8]; v32 = v12[9]; if ( (int)v30 >= v32 ) { if ( v32 == v12[10] ) { google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)(v12 + 6), v32 + 1); v32 = v12[9]; } v12[9] = v32 + 1; v21 = operator new(0x28u); HDDMXng::AttrSetting::AttrSetting((HDDMXng::AttrSetting *)v21); v22 = (int)v12[8]; v23 = *((_QWORD *)v12 + 3); v12[8] = v22 + 1; *(_QWORD *)(v23 + 8 * v22) = v21; } else { v31 = *((_QWORD *)v12 + 3); v12[8] = v30 + 1; v21 = *(_QWORD *)(v31 + 8 * v30); } v24 = *v18; if ( (v18[1] - *v18) >> 4 <= i ) std::__throw_out_of_range("vector::_M_range_check"); *(_DWORD *)(v21 + 36) |= 1u; p__ZN6google8protobuf8internal12kEmptyStringE_1 = *(std::string **)(v21 + 16); v26 = (const std::string *)(16 * i + v24); if ( p__ZN6google8protobuf8internal12kEmptyStringE_1 == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_1 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_1 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(v21 + 16) = p__ZN6google8protobuf8internal12kEmptyStringE_1; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_1, v26); v27 = *v18; if ( (v18[1] - *v18) >> 4 <= i ) std::__throw_out_of_range("vector::_M_range_check"); *(_DWORD *)(v21 + 36) |= 2u; p__ZN6google8protobuf8internal12kEmptyStringE_2 = *(std::string **)(v21 + 24); v29 = (const std::string *)(v27 + 16 * i + 8); if ( p__ZN6google8protobuf8internal12kEmptyStringE_2 == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_2 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_2 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(v21 + 24) = p__ZN6google8protobuf8internal12kEmptyStringE_2; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_2, v29); if ( (v18[1] - *v18) >> 4 <= v19 ) break; } } } } } ++v45; } while ( v47 > (int)v45 ); } ++v48; } while ( v49 > (int)v48 ); } } HDDMBelDef_2 = this; qword18 = (const google::protobuf::Message *)this->qword18; if ( qword18 ) { v35 = *((_QWORD *)qword18 + 1) - *(_QWORD *)qword18; v65 |= 0x80u; v60 = v35 >> 3; HDDMBelDef_2 = this; } if ( HDDMBelDef_2->hddmBelUsageDef ) { v65 |= 0x400u; v57 = 1; } HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v52, qword18); if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "PINS", 4); v36 = 0; if ( (this->beldef_code & 0x3FFF) != 0 ) { do HDDMBelPinDef::writeme_pb(&this->hddmBelPinDefArray[v36++], stream); while ( (this->beldef_code & 0x3FFF) > (int)v36 ); } if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "PRIMS", 5); qword18_1 = (__int64 *)this->qword18; if ( qword18_1 ) { v38 = *qword18_1; v39 = (qword18_1[1] - *qword18_1) >> 3; if ( (int)v39 > 0 ) { v40 = 0; v41 = 8LL * (unsigned int)(v39 - 1) + 8; while ( 1 ) { v42 = *(_DWORD **)(v38 + v40); *(_WORD *)v51 = v42[2]; std::ostream::write(stream, v51, 2); HDDMDeviceDump::dumpbinary((HDDMDeviceDump *)v51, (const char *)&dword_0 + 2, (int)"beldef:", v43); (*(void (__fastcall **)(_DWORD *, std::ostream *))(*(_QWORD *)v42 + 8LL))(v42, stream); v40 += 8; if ( v40 == v41 ) break; v38 = *(_QWORD *)this->qword18; } } } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) HDDMBelUsageDef::writeme_pb(hddmBelUsageDef, stream); HDDMXng::BelDef::~BelDef((HDDMXng::BelDef *)v52); } void __fastcall HDDMBelDef::print(HDDMBelDef *this, std::ostream *stream, const std::string *fileName) { __int64 v4; // rbp __int64 v5; // rax __int64 v6; // r12 __int64 v7; // rax __int64 v8; // rbp __int64 v9; // r12 __int64 v10; // r14 __int64 v11; // rbp __int64 v12; // rbp __int64 v13; // rax __int64 v14; // r12 __int64 v15; // rbp __int64 v16; // r14 __int64 v17; // r12 __int64 v18; // r12 __int64 v19; // rax __int64 *qword18; // rdx __int64 v21; // rax __int64 v22; // rdx __int64 v23; // r12 __int64 v24; // r14 char v25; // al std::ostream *v26; // rax std::ostream *v27; // rbp __int64 v28; // rax __int64 v29; // rdx __int16 beldef_code; // ax __int64 v31; // r14 int v32; // ebp __int64 v33; // rax _BYTE *v34; // r12 char v35; // al std::ostream *v36; // rax __int64 v37; // rbp int v38; // eax __int64 v39; // rbp __int64 v40; // rax __int64 v41; // r14 std::ostream *v42; // r14 __int64 v43; // rax char v44; // al std::ostream *v45; // rax __int64 v46; // rbp HDDMBelUsageDef *hddmBelUsageDef; // rdi __int64 v48; // rax __int64 v49; // rax unsigned __int16 v50; // [rsp+0h] [rbp-58h] unsigned __int16 v51; // [rsp+0h] [rbp-58h] __int64 v52; // [rsp+0h] [rbp-58h] int v53; // [rsp+0h] [rbp-58h] unsigned int v54; // [rsp+8h] [rbp-50h] __int64 v55; // [rsp+8h] [rbp-50h] __int64 v56; // [rsp+10h] [rbp-48h] int v57; // [rsp+1Ch] [rbp-3Ch] v4 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v4, "BELDEF ", 7); v5 = std::__ostream_insert<char,std::char_traits<char>>(v4, this->belDef_name, *((_QWORD *)this->belDef_name - 3)); std::endl<char,std::char_traits<char>>(v5); LOBYTE(v4) = this->beldef_code1 & 0xF; v6 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v6, " m_deviceid : ", 14); v7 = std::ostream::_M_insert<unsigned long>(v6, (unsigned __int8)v4); std::endl<char,std::char_traits<char>>(v7); v8 = HIBYTE(this->beldef_code) >> 5; v50 = (this->beldef_code >> 14) & 0x3FFF; v9 = this->beldef_code & 0x3FFF; v10 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v10, "m_rbel : ", 9); v11 = std::ostream::_M_insert<unsigned long>(v10, v8 & 1); std::__ostream_insert<char,std::char_traits<char>>(v11, " m_numpins: ", 12); v12 = std::ostream::_M_insert<unsigned long>(v11, (unsigned __int16)v9); std::__ostream_insert<char,std::char_traits<char>>(v12, " m_numinputpins : ", 18); v13 = std::ostream::_M_insert<unsigned long>(v12, v50); std::endl<char,std::char_traits<char>>(v13); v14 = HIBYTE(this->beldef_code) >> 4; v51 = (this->beldef_code1 >> 4) & 0x3FFF; v15 = HIWORD(this->beldef_code1) >> 2; v16 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v16, "m_optinv : ", 11); v17 = std::ostream::_M_insert<unsigned long>(v16, v14 & 1); std::__ostream_insert<char,std::char_traits<char>>(v17, " m_numoutputpins : ", 19); v18 = std::ostream::_M_insert<unsigned long>(v17, v51); std::__ostream_insert<char,std::char_traits<char>>(v18, " m_index : ", 11); v19 = std::ostream::_M_insert<unsigned long>(v18, v15 & 0xFFF); std::endl<char,std::char_traits<char>>(v19); qword18 = (__int64 *)this->qword18; if ( qword18 ) { v21 = *qword18; v22 = (qword18[1] - *qword18) >> 3; if ( (int)v22 > 0 ) { v23 = 0; v24 = 8LL * (unsigned int)(v22 - 1) + 8; while ( 1 ) { (*(void (__fastcall **)(_QWORD, std::ostream *, const std::string *))(**(_QWORD **)(v21 + v23) + 32LL))( *(_QWORD *)(v21 + v23), stream, fileName); v27 = (std::ostream *)std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v27, ";", 1); v28 = *(_QWORD *)(*(_QWORD *)v27 - 24LL); v29 = *(_QWORD *)((char *)v27 + v28 + 240); if ( !v29 ) break; if ( *(_BYTE *)(v29 + 56) ) { v25 = *(_BYTE *)(v29 + 67); } else { v52 = *(_QWORD *)((char *)v27 + v28 + 240); std::ctype<char>::_M_widen_init(v52); v25 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v52 + 48LL))(v52, 10); } v23 += 8; v26 = (std::ostream *)std::ostream::put(v27, v25); std::ostream::flush(v26); if ( v23 == v24 ) goto LABEL_10; v21 = *(_QWORD *)this->qword18; } LABEL_38: std::__throw_bad_cast(); } } LABEL_10: beldef_code = this->beldef_code; if ( (beldef_code & 0x3FFF) != 0 ) { v48 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); v49 = std::operator<<<std::char_traits<char>>(v48, "PINS : "); std::endl<char,std::char_traits<char>>(v49); beldef_code = this->beldef_code; } v31 = 0; v32 = 0; while ( v32 < (beldef_code & 0x3FFF) ) { ++v32; HDDMBelPinDef::print(&this->hddmBelPinDefArray[v31], stream, fileName); if ( v32 == (this->beldef_code & 0x3FFF) ) { std::__ostream_insert<char,std::char_traits<char>>(stream, ";", 1); std::endl<char,std::char_traits<char>>(stream); } else { std::__ostream_insert<char,std::char_traits<char>>(stream, ",", 1); v33 = *(_QWORD *)(*(_QWORD *)stream - 24LL); v34 = *(_BYTE **)((char *)stream + v33 + 240); if ( !v34 ) goto LABEL_38; if ( v34[56] ) { v35 = v34[67]; } else { std::ctype<char>::_M_widen_init(*(_QWORD *)((char *)stream + v33 + 240)); v35 = (*(__int64 (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v34 + 48LL))(v34, 10); } v36 = (std::ostream *)std::ostream::put(stream, v35); std::ostream::flush(v36); } beldef_code = this->beldef_code; ++v31; } if ( this->qword20 ) { v37 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v37, "PIPS:", 5); std::endl<char,std::char_traits<char>>(v37); v38 = (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code1 >> 4) & 0x3FFF) + ((this->beldef_code >> 14) & 0x3FFF))); v53 = v38 + ((this->beldef_code1 >> 4) & 0x3FFF); v57 = v38 + ((this->beldef_code >> 14) & 0x3FFF); if ( v57 ) { v56 = 0; while ( !v53 ) { LABEL_33: if ( v57 <= (int)++v56 ) goto LABEL_34; } v39 = 0; while ( 1 ) { while ( !*(_BYTE *)(*(_QWORD *)(this->qword20 + 8 * v56) + v39) ) { if ( v53 <= (int)++v39 ) goto LABEL_33; } v54 = ((this->beldef_code >> 14) & 0x3FFF) + v39; v40 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); v41 = std::ostream::operator<<(v40, (unsigned int)v56); std::__ostream_insert<char,std::char_traits<char>>(v41, " : ", 3); v42 = (std::ostream *)std::ostream::operator<<(v41, v54); std::__ostream_insert<char,std::char_traits<char>>(v42, ",", 1); v43 = *(_QWORD *)((char *)v42 + *(_QWORD *)(*(_QWORD *)v42 - 24LL) + 240); if ( !v43 ) goto LABEL_38; if ( *(_BYTE *)(v43 + 56) ) { v44 = *(_BYTE *)(v43 + 67); } else { v55 = *(_QWORD *)((char *)v42 + *(_QWORD *)(*(_QWORD *)v42 - 24LL) + 240); std::ctype<char>::_M_widen_init(v55); v44 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v55 + 48LL))(v55, 10); } ++v39; v45 = (std::ostream *)std::ostream::put(v42, v44); std::ostream::flush(v45); if ( v53 <= (int)v39 ) goto LABEL_33; } } LABEL_34: v46 = std::__ostream_insert<char,std::char_traits<char>>( stream, *(_QWORD *)fileName, *(_QWORD *)(*(_QWORD *)fileName - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v46, ";", 1); std::endl<char,std::char_traits<char>>(v46); } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) HDDMBelUsageDef::print(hddmBelUsageDef, stream, fileName); } void HDDMBelDef::allocatepindefs(HDDMBelDef *this, unsigned __int16 count) { __int64 v2; // rbx _QWORD *v3; // rax HDDMBelPinDef *hddmBelPinDefArray; // r14 HDDMBelPinDef *v5; // rbp __int16 beldef_code; // ax v2 = count - 1LL; v3 = (_QWORD *)operator new[](16LL * count + 8); hddmBelPinDefArray = (HDDMBelPinDef *)(v3 + 1); *v3 = count; v5 = (HDDMBelPinDef *)(v3 + 1); if ( count ) { do { HDDMBelPinDef::HDDMBelPinDef(v5); --v2; ++v5; } while ( v2 != -1 ); } beldef_code = this->beldef_code; this->hddmBelPinDefArray = hddmBelPinDefArray; LOWORD(this->beldef_code) = count & 0x3FFF | beldef_code & 0xC000; } void __fastcall HDDMBelDef::createpindefsmap(HDDMBelDef *this) { __int64 qword30_1; // rax HDDMBelPinDef *v2; // r12 _QWORD *v3; // r14 _QWORD *pindef_name; // rbx __int64 v5; // rbp size_t n_3; // r13 int v7; // eax _QWORD *s1; // rdi size_t n_2; // r15 size_t n; // rdx _QWORD *s2; // rsi size_t n_1; // rdx int v13; // eax unsigned __int16 v14; // [rsp+6h] [rbp-82h] __int64 v15; // [rsp+8h] [rbp-80h] size_t n_4; // [rsp+8h] [rbp-80h] __int64 qword30; // [rsp+10h] [rbp-78h] char v19; // [rsp+3Fh] [rbp-49h] BYREF _QWORD *p_pindef_name; // [rsp+40h] [rbp-48h] BYREF qword30_1 = operator new(0x30u); *(_DWORD *)(qword30_1 + 8) = 0; *(_QWORD *)(qword30_1 + 16) = 0; *(_QWORD *)(qword30_1 + 40) = 0; qword30 = qword30_1; *(_QWORD *)(qword30_1 + 24) = qword30_1 + 8; *(_QWORD *)(qword30_1 + 32) = qword30_1 + 8; this->qword30 = qword30_1; v15 = qword30_1 + 8; v14 = 0; if ( (this->beldef_code & 0x3FFF) == 0 ) return; while ( 2 ) { v2 = &this->hddmBelPinDefArray[v14]; v3 = *(_QWORD **)(qword30 + 16); if ( !v3 ) { v5 = v15; goto LABEL_24; } pindef_name = (_QWORD *)v2->pindef_name; v5 = v15; n_3 = *(pindef_name - 3); do { while ( 1 ) { s1 = (_QWORD *)v3[4]; n_2 = *(s1 - 3); n = n_2; if ( n_3 <= n_2 ) n = n_3; v7 = memcmp(s1, pindef_name, n); if ( !v7 ) break; LABEL_5: if ( v7 < 0 ) goto LABEL_12; LABEL_6: v5 = (__int64)v3; v3 = (_QWORD *)v3[2]; if ( !v3 ) goto LABEL_13; } if ( (__int64)(n_2 - n_3) > 0x7FFFFFFF ) goto LABEL_6; if ( (__int64)(n_2 - n_3) >= (__int64)0xFFFFFFFF80000000LL ) { v7 = n_2 - n_3; goto LABEL_5; } LABEL_12: v3 = (_QWORD *)v3[3]; } while ( v3 ); LABEL_13: if ( v15 == v5 ) goto LABEL_24; s2 = *(_QWORD **)(v5 + 32); n_1 = *(s2 - 3); n_4 = n_1; if ( n_3 <= n_1 ) n_1 = n_3; v13 = memcmp(pindef_name, s2, n_1); if ( v13 ) { LABEL_20: if ( v13 < 0 ) goto LABEL_24; } else if ( (__int64)(n_3 - n_4) <= 0x7FFFFFFF ) { if ( (__int64)(n_3 - n_4) >= (__int64)0xFFFFFFFF80000000LL ) { v13 = n_3 - n_4; goto LABEL_20; } LABEL_24: p_pindef_name = &v2->pindef_name; v5 = std::_Rb_tree<std::string,std::pair<std::string const,HDDMBelPinDef *>,std::_Select1st<std::pair<std::string const,HDDMBelPinDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMBelPinDef *>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&,std::tuple<std::string const&>,std::tuple<>>( qword30, v5, &unk_7B5CA99, &p_pindef_name, &v19); } *(_QWORD *)(v5 + 40) = v2; if ( ++v14 < (this->beldef_code & 0x3FFF) ) { qword30 = this->qword30; v15 = qword30 + 8; continue; } break; } } void __fastcall HDDMBelDef::addpindefs(HDDMBelDef *this, __int16 index) { HDDMBelPinDef *hddmBelPinDefArray; // rbx unsigned __int16 v3; // r12 __int64 v4; // r14 __int64 v5; // r12 char *v6; // rax char *v7; // rdx char v8; // cl char v9; // cl char v10; // cl char v11; // cl char v12; // cl char v13; // cl char v14; // cl char v15; // cl char v16; // cl char v17; // cl char v18; // cl char v19; // cl char v20; // cl const std::string *v21; // rsi HDDMBelPinDef *i; // rbp hddmBelPinDefArray = this->hddmBelPinDefArray; v3 = this->beldef_code & 0x3FFF; HDDMBelDef::allocatepindefs(this, v3 + index); if ( v3 ) { v4 = 0; v5 = 16 * ((unsigned int)v3 - 1 + 1LL); do { v6 = (char *)this->hddmBelPinDefArray + v4; v7 = (char *)hddmBelPinDefArray + v4; v8 = *((_BYTE *)hddmBelPinDefArray + v4) & 1 | *v6 & 0xFE; *v6 = v8; v9 = *((_BYTE *)hddmBelPinDefArray + v4) & 2 | v8 & 0xFD; *v6 = v9; v10 = *((_BYTE *)hddmBelPinDefArray + v4) & 4 | v9 & 0xFB; *v6 = v10; v11 = *((_BYTE *)hddmBelPinDefArray + v4) & 8 | v10 & 0xF7; *v6 = v11; v12 = *((_BYTE *)hddmBelPinDefArray + v4) & 0x10 | v11 & 0xEF; *v6 = v12; *v6 = *((_BYTE *)hddmBelPinDefArray + v4) & 0x20 | v12 & 0xDF; *(_DWORD *)v6 = *(_DWORD *)((_BYTE *)hddmBelPinDefArray + v4) & 0xFFFC0 | *(_DWORD *)v6 & 0xFFF0003F; v6[2] = *((_BYTE *)hddmBelPinDefArray + v4 + 2) & 0xF0 | v6[2] & 0xF; v13 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 1 | v6[3] & 0xFE; v6[3] = v13; v14 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 2 | v13 & 0xFD; v6[3] = v14; v15 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 4 | v14 & 0xFB; v6[3] = v15; v16 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 8 | v15 & 0xF7; v6[3] = v16; v17 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 0x10 | v16 & 0xEF; v6[3] = v17; v18 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 0x20 | v17 & 0xDF; v6[3] = v18; v19 = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 0x40 | v18 & 0xBF; v6[3] = v19; v6[3] = *((_BYTE *)hddmBelPinDefArray + v4 + 3) & 0x80 | v19 & 0x7F; v6[4] = *((_BYTE *)hddmBelPinDefArray + v4 + 4) & 0xF | v6[4] & 0xF0; *((_WORD *)v6 + 2) = *(_WORD *)((_BYTE *)hddmBelPinDefArray + v4 + 4) & 0xFFF0 | *((_WORD *)v6 + 2) & 0xF; *((_WORD *)v6 + 3) = *(_WORD *)((_BYTE *)hddmBelPinDefArray + v4 + 6) & 0x3FF | *((_WORD *)v6 + 3) & 0xFC00; v20 = *((_BYTE *)hddmBelPinDefArray + v4 + 7) & 0x3C | v6[7] & 0xC3; v21 = (HDDMBelPinDef *)((char *)hddmBelPinDefArray + v4 + 8); v4 += 16; v6[7] = v20; v6[7] = v7[7] & 0xC0 | v20 & 0x3F; std::string::assign((std::string *)(v6 + 8), v21); } while ( v4 != v5 ); } if ( hddmBelPinDefArray ) { for ( i = (HDDMBelPinDef *)((char *)hddmBelPinDefArray + 16 * *((_QWORD *)hddmBelPinDefArray - 1)); hddmBelPinDefArray != i; HDDMBelPinDef::~HDDMBelPinDef(i) ) { i = (HDDMBelPinDef *)((char *)i - 16); } operator delete[]((char *)hddmBelPinDefArray - 8); } } void HDDMBelDef::allocatepindefs(HDDMBelDef *this, unsigned __int16 count) { __int64 v2; // rbx _QWORD *v3; // rax HDDMBelPinDef *hddmBelPinDefArray; // r14 HDDMBelPinDef *v5; // rbp __int16 beldef_code; // ax v2 = count - 1LL; v3 = (_QWORD *)operator new[](16LL * count + 8); hddmBelPinDefArray = (HDDMBelPinDef *)(v3 + 1); *v3 = count; v5 = (HDDMBelPinDef *)(v3 + 1); if ( count ) { do { HDDMBelPinDef::HDDMBelPinDef(v5); --v2; ++v5; } while ( v2 != -1 ); } beldef_code = this->beldef_code; this->hddmBelPinDefArray = hddmBelPinDefArray; LOWORD(this->beldef_code) = count & 0x3FFF | beldef_code & 0xC000; } void __fastcall HDDMBelDef::addprimitive(HDDMBelDef *this, HDDMPrimitive *Primitive) { HDDMPrimitive *hddmPrimitive; // rdi HDDMPrimitive **hddmBelDef; // rdx __int64 v5; // rdx __int64 qword18_1; // rax HDDMPrimitive *p_Primitive; // [rsp+8h] [rbp-10h] BYREF hddmPrimitive = this->hddmPrimitive; p_Primitive = Primitive; if ( !hddmPrimitive ) { qword18_1 = operator new(0x18u); *(_QWORD *)qword18_1 = 0; *(_QWORD *)(qword18_1 + 8) = 0; hddmPrimitive = (HDDMPrimitive *)qword18_1; *(_QWORD *)(qword18_1 + 16) = 0; this->hddmPrimitive = (HDDMPrimitive *)qword18_1; } hddmBelDef = *(HDDMPrimitive ***)&hddmPrimitive->numPrimType; if ( hddmBelDef == (HDDMPrimitive **)hddmPrimitive->hddmBelDef ) { std::vector<HDDMPrimitive *>::_M_emplace_back_aux<HDDMPrimitive * const&>(hddmPrimitive, &p_Primitive); } else { if ( hddmBelDef ) { *hddmBelDef = p_Primitive; v5 = *(_QWORD *)&hddmPrimitive->numPrimType; } else { v5 = 0; } *(_QWORD *)&hddmPrimitive->numPrimType = v5 + 8; } } void __fastcall HDDMBelDef::addusagedef(HDDMBelDef *this) { HDDMBelUsageDef *hddmBelUsageDef; // rbx hddmBelUsageDef = (HDDMBelUsageDef *)operator new(0x58u); HDDMBelUsageDef::HDDMBelUsageDef(hddmBelUsageDef); this->hddmBelUsageDef = hddmBelUsageDef; hddmBelUsageDef->qword50 = this; } void __fastcall HDDMBelDef::allocatepips(HDDMBelDef *this) { int v1; // ebx __int64 qword20_1; // rax unsigned int beldef_code1; // edx unsigned int beldef_code; // ecx int qword20_2; // r14d __int64 qword20; // r15 __int64 v7; // rbp __int64 v8; // rbx __int64 qword20_3; // rax v1 = (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code1 >> 4) & 0x3FFF) + ((this->beldef_code >> 14) & 0x3FFF))) + ((this->beldef_code >> 14) & 0x3FFF); qword20_1 = operator new[](8LL * v1); beldef_code1 = this->beldef_code1; beldef_code = this->beldef_code; this->qword20 = qword20_1; qword20_2 = (unsigned __int16)((this->beldef_code & 0x3FFF) - (((beldef_code >> 14) & 0x3FFF) + ((beldef_code1 >> 4) & 0x3FFF))) + ((beldef_code1 >> 4) & 0x3FFF); if ( v1 ) { qword20 = qword20_1; v7 = 8LL * (unsigned int)(v1 - 1) + 8; v8 = 0; while ( 1 ) { *(_QWORD *)(v8 + qword20) = operator new[](qword20_2); qword20_3 = 0; if ( qword20_2 ) { do *(_BYTE *)(*(_QWORD *)(this->qword20 + v8) + qword20_3++) = 0; while ( qword20_2 > (int)qword20_3 ); } v8 += 8; if ( v8 == v7 ) break; qword20 = this->qword20; } } } _QWORD *__fastcall HDDMBelDef::buildReservedBelTypes(HDDMBelDef *this, HDDMDevice *a2) { _QWORD *v2; // rax __int64 v3; // rax __int64 Site; // rbx int i; // ebp HDDMElement *Element; // rax __int64 BelDef; // rax _WORD *v8; // rax _QWORD *v10; // [rsp+8h] [rbp-90h] char v11; // [rsp+2Fh] [rbp-69h] BYREF HDDMSite v12; // [rsp+30h] [rbp-68h] BYREF _QWORD v13[9]; // [rsp+50h] [rbp-48h] BYREF v2 = (_QWORD *)operator new(0x18u); *v2 = 0; v2[1] = 0; v2[2] = 0; v10 = v2; v3 = (__int64)(*((_QWORD *)this + 16) - *((_QWORD *)this + 15)) >> 3; if ( (_WORD)v3 ) std::vector<unsigned char>::_M_fill_insert(v10, 0, (unsigned __int16)v3, &unk_7B5CA98); std::string::string(v13, "CFG_IO_ACCESS", &v12); sub_2165630(this, v10, v13, 2); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "USR_ACCESS", &v12); sub_2165630(this, v10, v13, 3); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "EFUSE_USR", &v12); sub_2165630(this, v10, v13, 3); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "DCIRESET", &v12); sub_2165630(this, v10, v13, 3); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "ICAP_TOP", &v12); sub_2165630(this, v10, v13, 4); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "ICAP_BOT", &v12); sub_2165630(this, v10, v13, 4); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "STARTUP", &v12); sub_2165630(this, v10, v13, 4); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "FRAME_ECC", &v12); sub_2165630(this, v10, v13, 4); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); std::string::string(v13, "PS8_X0Y0", &v12); Site = HDDMDevice::getSite((HDDMDevice *)this, (const std::string *)v13); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v12.qword10); if ( Site ) { for ( i = 0; ; ++i ) { v8 = (_WORD *)(*(_QWORD *)(HDDMDeviceCache::m_devcache[(*(_BYTE *)(Site + 8) >> 2) & 0xF] + 240LL) + 48LL * ((*(_DWORD *)Site >> 2) & 0x3FFFFF)); if ( i >= ((*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(HDDMDeviceCache::m_devcache[(*v8 >> 6) & 0xF] + 168LL) + 8LL * (v8[2] & 0x3FF)) + 120LL) + 8LL * *(unsigned __int8 *)(Site + 3)) + 12LL) >> 6) & 0x1FFF) ) break; HDDMSite::getBel(&v12, Site); if ( (unsigned __int8)HDDMBel::isBad((HDDMBel *)&v12) ) { HDDMBel::~HDDMBel((HDDMBel *)&v12); } else { Element = (HDDMElement *)HDDMBel::getElement((HDDMBel *)&v12); BelDef = HDDMElement::getBelDef(Element); std::string::string((std::string *)&v12.qword10, (const std::string *)(BelDef + 16)); if ( !strcmp((const char *)v12.qword10, "PSS_ALTO_CORE") || !strcmp((const char *)v12.qword10, "PSS_ALTO_CORE_PAD_CLK") ) { std::string::_Rep::_M_dispose(v12.qword10 - 24LL, v13); HDDMBel::~HDDMBel((HDDMBel *)&v12); } else { std::string::string((std::string *)v13, (const std::string *)&v12.qword10); sub_2165630(this, v10, v13, 1); std::string::_Rep::_M_dispose(v13[0] - 24LL, &v11); std::string::_Rep::_M_dispose(v12.qword10 - 24LL, v13); HDDMBel::~HDDMBel((HDDMBel *)&v12); } } } } return v10; } void __fastcall HDDMBelDef::createpindefsmap(HDDMBelDef *this) { __int64 qword30_1; // rax HDDMBelPinDef *v2; // r12 _QWORD *v3; // r14 _QWORD *pindef_name; // rbx __int64 v5; // rbp size_t n_3; // r13 int v7; // eax _QWORD *s1; // rdi size_t n_2; // r15 size_t n; // rdx _QWORD *s2; // rsi size_t n_1; // rdx int v13; // eax unsigned __int16 v14; // [rsp+6h] [rbp-82h] __int64 v15; // [rsp+8h] [rbp-80h] size_t n_4; // [rsp+8h] [rbp-80h] __int64 qword30; // [rsp+10h] [rbp-78h] char v19; // [rsp+3Fh] [rbp-49h] BYREF _QWORD *p_pindef_name; // [rsp+40h] [rbp-48h] BYREF qword30_1 = operator new(0x30u); *(_DWORD *)(qword30_1 + 8) = 0; *(_QWORD *)(qword30_1 + 16) = 0; *(_QWORD *)(qword30_1 + 40) = 0; qword30 = qword30_1; *(_QWORD *)(qword30_1 + 24) = qword30_1 + 8; *(_QWORD *)(qword30_1 + 32) = qword30_1 + 8; this->qword30 = qword30_1; v15 = qword30_1 + 8; v14 = 0; if ( (this->beldef_code & 0x3FFF) == 0 ) return; while ( 2 ) { v2 = &this->hddmBelPinDefArray[v14]; v3 = *(_QWORD **)(qword30 + 16); if ( !v3 ) { v5 = v15; goto LABEL_24; } pindef_name = (_QWORD *)v2->pindef_name; v5 = v15; n_3 = *(pindef_name - 3); do { while ( 1 ) { s1 = (_QWORD *)v3[4]; n_2 = *(s1 - 3); n = n_2; if ( n_3 <= n_2 ) n = n_3; v7 = memcmp(s1, pindef_name, n); if ( !v7 ) break; LABEL_5: if ( v7 < 0 ) goto LABEL_12; LABEL_6: v5 = (__int64)v3; v3 = (_QWORD *)v3[2]; if ( !v3 ) goto LABEL_13; } if ( (__int64)(n_2 - n_3) > 0x7FFFFFFF ) goto LABEL_6; if ( (__int64)(n_2 - n_3) >= (__int64)0xFFFFFFFF80000000LL ) { v7 = n_2 - n_3; goto LABEL_5; } LABEL_12: v3 = (_QWORD *)v3[3]; } while ( v3 ); LABEL_13: if ( v15 == v5 ) goto LABEL_24; s2 = *(_QWORD **)(v5 + 32); n_1 = *(s2 - 3); n_4 = n_1; if ( n_3 <= n_1 ) n_1 = n_3; v13 = memcmp(pindef_name, s2, n_1); if ( v13 ) { LABEL_20: if ( v13 < 0 ) goto LABEL_24; } else if ( (__int64)(n_3 - n_4) <= 0x7FFFFFFF ) { if ( (__int64)(n_3 - n_4) >= (__int64)0xFFFFFFFF80000000LL ) { v13 = n_3 - n_4; goto LABEL_20; } LABEL_24: p_pindef_name = &v2->pindef_name; v5 = std::_Rb_tree<std::string,std::pair<std::string const,HDDMBelPinDef *>,std::_Select1st<std::pair<std::string const,HDDMBelPinDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMBelPinDef *>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&,std::tuple<std::string const&>,std::tuple<>>( qword30, v5, &unk_7B5CA99, &p_pindef_name, &v19); } *(_QWORD *)(v5 + 40) = v2; if ( ++v14 < (this->beldef_code & 0x3FFF) ) { qword30 = this->qword30; v15 = qword30 + 8; continue; } break; } } __int64 __fastcall HDDMBelDef::getNumArcs(HDDMBelDef *this, __int16 nIndex) { int v2; // eax int NumFwdArcs; // r12d v2 = *(_BYTE *)(HDDMBelDef::getPinDef(this, nIndex) + 7) & 0xC0; if ( !v2 ) return HDDMBelDef::getNumFwdArcs(this, nIndex); if ( (_BYTE)v2 == 0x80 ) return HDDMBelDef::getNumReverseArcs(this, nIndex); NumFwdArcs = HDDMBelDef::getNumFwdArcs(this, nIndex); return NumFwdArcs + (unsigned int)HDDMBelDef::getNumReverseArcs(this, nIndex); } __int64 __fastcall HDDMBelDef::getNumFwdArcs(HDDMBelDef *this, unsigned __int16 nIndex) { __int64 qword20; // rcx unsigned __int16 v3; // r9 int v4; // eax int v5; // edi __int64 v6; // rdx __int64 result; // rax __int64 v8; // rsi qword20 = this->qword20; if ( !qword20 ) return 0; v3 = (this->beldef_code1 >> 4) & 0x3FFF; v4 = (unsigned __int16)((this->beldef_code & 0x3FFF) - (((this->beldef_code >> 14) & 0x3FFF) + v3)); v5 = v4 + ((this->beldef_code1 >> 4) & 0x3FFF); if ( !(v4 + v3) ) return 0; v6 = 0; result = 0; v8 = *(_QWORD *)(qword20 + 8LL * nIndex); do { if ( *(_BYTE *)(v8 + v6) ) result = (unsigned int)(result + 1); ++v6; } while ( v5 > (int)v6 ); return result; } __int64 __fastcall HDDMBelDef::setrecursivedeviceid(HDDMBelDef *this, unsigned __int16 a2) { __int64 v2; // rdx int v3; // r9d int v4; // ecx __int64 result; // rax char v6; // r9 bool v7; // zf HDDMBelUsageDef *hddmBelUsageDef; // rdi v2 = 0; v3 = a2 & 0xF; v4 = 0; result = v3 | this->beldef_code1 & 0xF0u; v6 = 16 * v3; v7 = (this->beldef_code & 0x3FFF) == 0; LOBYTE(this->beldef_code1) = result; if ( !v7 ) { do { ++v4; BYTE2(this->hddmBelPinDefArray[v2].pindef_code) = v6 | BYTE2(this->hddmBelPinDefArray[v2].pindef_code) & 0xF; ++v2; result = this->beldef_code & 0x3FFF; } while ( (int)result > v4 ); } hddmBelUsageDef = this->hddmBelUsageDef; if ( hddmBelUsageDef ) return HDDMBelUsageDef::setrecursivedeviceid(hddmBelUsageDef, a2); return result; }
10-21
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持所有原始功能不变,不要遗漏逻辑细节 2.提高执行效率,降低计算复杂度 3.已经给定的结构体名字和元素不要更改,详细的中文注释 4.自动添加中文注释说明功能逻辑 5.不使用 auto,使用显式 for 循环 6.结构体采用32位定义 7.不要使用小函数,保持原始的函数定义 8.严格保持protobuf字段映射关系 特别注意: 1.函数中有关位操作不变,函数间的位操作一致 2.函数中的 HDDMXng::BelUsageAttrib::BelUsageAttrib 映射为 message BelUsageAttrib { optional uint32 flags = 1; optional uint32 type = 2; optional uint32 bitwidth = 3; optional string attribname = 4; optional sint32 defint = 5; optional double defdouble = 6; optional bool defbool = 7; optional string defstring = 8; repeated sint32 listofints = 9 [packed = true]; repeated double listofdoubles = 10 [packed = true]; repeated bool listofbools = 11 [packed = true]; repeated string listofstrings = 12; optional uint32 precision = 13; } 3.采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 进行编程 将函数中的 _BYTE attrib_msg[24] 映射为 HDDMXng::BelUsageAttrib attrib_msg 仔细解析 _BYTE attrib_msg[24] 所有字段 void __fastcall HDDMBelUsageAttrib::readme_pb(HDDMBelUsageAttrib *this, std::istream *stream, HDDMDevice *hddmDevice) { google::protobuf::Message *v4; // rdx unsigned int v5; // ecx bool v6; // zf _QWORD *v7; // r12 _QWORD *qword30_1; // rbp unsigned __int64 v9; // r15 _QWORD *qword28_8; // r13 __int64 v11; // rbp __int64 v12; // rax __int64 v13; // rcx __int64 v14; // rdi unsigned __int64 v15; // rdx int v16; // esi __int64 v17; // rsi __int64 v18; // rcx int v19; // r8d int v20; // r9d void *n_23; // r14 char *s2_4; // rbp __int64 qword48_3; // r13 char *p_char40_6; // r15 int v25; // eax unsigned __int64 n_24; // r12 size_t n_9; // rdx __int64 n0x7FFFFFFF_3; // r12 unsigned __int64 n_25; // rcx size_t n_10; // rdx int v31; // eax __int64 p_char40_7; // rax int v33; // eax __int64 *qword28_9; // rax unsigned __int64 v35; // rdx unsigned __int64 v36; // rsi __int64 v37; // r12 __int64 qword28_10; // rax __int64 qword28_6; // r13 unsigned __int64 n_6; // r14 char *s_2; // rbp __int64 qword48_6; // r8 signed __int64 v43; // r9 __int64 v44; // rax char *v45; // r15 __int64 v46; // r12 int v47; // edi char v48; // si __int64 *v49; // rdi __int64 v50; // rax __int64 v51; // rax void *n_19; // r13 __int64 *s2_3; // rbp __int64 qword48_2; // r14 char *p_char40_4; // r15 int v56; // eax unsigned __int64 n_20; // r12 size_t n_7; // rdx __int64 n0x7FFFFFFF_2; // r12 unsigned __int64 n_21; // rcx size_t n_8; // rdx int v62; // eax __int64 p_char40_5; // rax int v64; // r13d char **qword28_7; // rax unsigned __int64 v66; // rdx unsigned __int64 v67; // rsi unsigned __int64 v68; // r13 _QWORD *qword28_5; // rax _QWORD *qword28_3; // r12 unsigned __int64 n_3; // r13 char *s_1; // rax char *v73; // r14 char *s_4; // rbp signed __int64 v75; // r9 __int64 qword48_5; // r8 void *n_15; // r14 __int64 *s2_2; // rbp __int64 qword48_1; // r13 char *p_char40_2; // r15 int v81; // eax unsigned __int64 n_16; // r12 size_t n_4; // rdx __int64 n0x7FFFFFFF_1; // r12 unsigned __int64 n_17; // rcx size_t n_5; // rdx int v87; // eax __int64 p_char40_3; // rax char **qword28_4; // rax unsigned __int64 v90; // rdx unsigned __int64 v91; // rsi unsigned __int64 v92; // r13 _QWORD *qword28_1; // rax _QWORD *qword28_2; // r12 unsigned __int64 n; // r13 char *s; // rax char *v97; // r14 char *s_3; // rbp __int64 qword48; // r8 signed __int64 v100; // r9 __int64 v101; // rcx void *n_11; // r14 __int64 *s2_1; // rbp __int64 qword48_4; // r13 char *p_char40; // r15 int v106; // eax unsigned __int64 n_12; // r12 size_t n_1; // rdx __int64 n0x7FFFFFFF; // r12 unsigned __int64 n_13; // rcx size_t n_2; // rdx int v112; // eax __int64 p_char40_1; // rax char **qword28; // rax unsigned __int64 v115; // rdx unsigned __int64 v116; // rsi signed __int64 v117; // r9 int v118; // eax int v119; // ecx int v120; // edx unsigned __int64 v121; // [rsp+0h] [rbp-1E8h] unsigned __int64 v122; // [rsp+0h] [rbp-1E8h] int v123; // [rsp+0h] [rbp-1E8h] int v124; // [rsp+0h] [rbp-1E8h] unsigned __int64 v125; // [rsp+8h] [rbp-1E0h] unsigned __int64 v126; // [rsp+8h] [rbp-1E0h] unsigned __int64 n_26; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_22; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_18; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_14; // [rsp+20h] [rbp-1C8h] void **s1_1; // [rsp+40h] [rbp-1A8h] BYREF void **s1_2; // [rsp+50h] [rbp-198h] BYREF void **s1_3; // [rsp+60h] [rbp-188h] BYREF void **s2_5; // [rsp+70h] [rbp-178h] BYREF void *s1_4[2]; // [rsp+80h] [rbp-168h] BYREF __int64 v136; // [rsp+90h] [rbp-158h] BYREF void *s1_5[2]; // [rsp+A0h] [rbp-148h] BYREF __int64 v138; // [rsp+B0h] [rbp-138h] BYREF void *s1[2]; // [rsp+C0h] [rbp-128h] BYREF __int64 v140; // [rsp+D0h] [rbp-118h] BYREF void *s2[2]; // [rsp+E0h] [rbp-108h] BYREF char v142; // [rsp+F0h] [rbp-F8h] BYREF _BYTE attrib_msg[24]; // [rsp+100h] [rbp-E8h] BYREF int v144; // [rsp+118h] [rbp-D0h] __int64 v145; // [rsp+120h] [rbp-C8h] int v146; // [rsp+130h] [rbp-B8h] __int64 v147; // [rsp+138h] [rbp-B0h] int v148; // [rsp+148h] [rbp-A0h] __int64 v149; // [rsp+150h] [rbp-98h] int v150; // [rsp+168h] [rbp-80h] __int64 v151; // [rsp+170h] [rbp-78h] __int64 v152; // [rsp+178h] [rbp-70h] _QWORD *v153; // [rsp+180h] [rbp-68h] unsigned int v154; // [rsp+188h] [rbp-60h] char v155; // [rsp+18Ch] [rbp-5Ch] __int16 v156; // [rsp+190h] [rbp-58h] int v157; // [rsp+194h] [rbp-54h] __int64 qword30; // [rsp+198h] [rbp-50h] char v159; // [rsp+1A0h] [rbp-48h] char v160; // [rsp+1A4h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)attrib_msg, v4); v5 = (4 * ((v154 >> 3) & 1)) | (2 * ((v154 >> 2) & 1)) & 0xFFFFFFBB | ((v154 & 2) != 0) | HIBYTE(this->attrib_flags) & 0xB8 | (((v154 >> 4) & 1) << 6); BYTE1(this->attrib_type) = ((unsigned __int8)(v154 >> 7) << 7) | (((v154 & 0x40) != 0) << 6) & 0x7F | (32 * ((v154 & 0x20) != 0)) & 0x7F | BYTE1(this->attrib_type) & 0x1F; v6 = (attrib_msg[16] & 0x10) == 0; HIBYTE(this->attrib_flags) = (8 * (v155 & 7)) | v5 & 0xC7; if ( !v6 ) LOWORD(this->attrib_flags) = v156 & 0xFFF | this->attrib_flags & 0xF000; std::string::_M_assign(&this->attrib_name, v152); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: v92 = v144; qword28_1 = (_QWORD *)operator new(0x18u); qword28_2 = qword28_1; *qword28_1 = 0; qword28_1[1] = 0; qword28_1[2] = 0; if ( !v92 ) { v119 = v144; qword28_1[2] = 0; qword28_1[1] = 0; this->qword28 = qword28_1; if ( v119 <= 0 ) goto LABEL_158; goto LABEL_163; } if ( v92 > 0x3FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n = 4 * v92; s = (char *)operator new(n); v97 = &s[n]; *qword28_2 = s; s_3 = s; qword28_2[2] = &s[n]; memset(s, 0, n); LODWORD(v100) = v144; qword28_2[1] = v97; this->qword28 = qword28_2; if ( (int)v100 <= 0 ) goto LABEL_158; if ( !n ) { LABEL_163: v116 = 0; v115 = 0; LABEL_164: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v116, v115); } v126 = 0; v101 = 0; v124 = 0; while ( 2 ) { *(_DWORD *)&s_3[4 * v101] = *(_DWORD *)(v145 + 4LL * v124 + 8); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s1_4, this, v124, v101, qword48, v100); qword48 = this->qword48; if ( !qword48 ) { p_char40 = (char *)&this->qword40; goto LABEL_149; } n_11 = s1_4[1]; s2_1 = (__int64 *)s1_4[0]; qword48_4 = this->qword48; p_char40 = (char *)&this->qword40; do { while ( 1 ) { n_12 = *(_QWORD *)(qword48_4 + 40); n_1 = (size_t)n_11; if ( n_12 <= (unsigned __int64)n_11 ) n_1 = *(_QWORD *)(qword48_4 + 40); if ( !n_1 ) break; v106 = memcmp(*(const void **)(qword48_4 + 32), s2_1, n_1); if ( !v106 ) break; if ( v106 < 0 ) goto LABEL_122; LABEL_115: p_char40 = (char *)qword48_4; qword48_4 = *(_QWORD *)(qword48_4 + 16); if ( !qword48_4 ) goto LABEL_123; } n0x7FFFFFFF = n_12 - (_QWORD)n_11; if ( n0x7FFFFFFF > 0x7FFFFFFF || n0x7FFFFFFF >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF >= 0 ) goto LABEL_115; LABEL_122: qword48_4 = *(_QWORD *)(qword48_4 + 24); } while ( qword48_4 ); LABEL_123: if ( p_char40 == (char *)&this->qword40 ) goto LABEL_149; n_13 = *((_QWORD *)p_char40 + 5); n_2 = (size_t)n_11; if ( n_13 <= (unsigned __int64)n_11 ) n_2 = *((_QWORD *)p_char40 + 5); if ( n_2 && (n_14 = *((_QWORD *)p_char40 + 5), v112 = memcmp(s2_1, *((const void **)p_char40 + 4), n_2), n_13 = n_14, v112) ) { if ( v112 >= 0 ) goto LABEL_129; LABEL_149: s1_1 = s1_4; p_char40_1 = sub_F187E0(&this->qword38, p_char40, &s1_1); s2_1 = (__int64 *)s1_4[0]; } else { p_char40_1 = (__int64)p_char40; v100 = (signed __int64)n_11 - n_13; if ( (__int64)((__int64)n_11 - n_13) <= 0x7FFFFFFF ) { if ( v100 < (__int64)0xFFFFFFFF80000000LL || (int)v100 < 0 ) goto LABEL_149; LABEL_129: p_char40_1 = (__int64)p_char40; } } *(_WORD *)(p_char40_1 + 64) = v124; if ( s2_1 != &v136 ) operator delete(s2_1); if ( ++v124 < v144 ) { qword28 = (char **)this->qword28; v101 = ++v126; s_3 = *qword28; v115 = (qword28[1] - *qword28) >> 2; if ( v115 <= v126 ) { v116 = v126; goto LABEL_164; } continue; } break; } LABEL_158: LODWORD(this->qword30) = v157; LABEL_7: if ( (attrib_msg[17] & 1) != 0 ) BYTE1(this->attrib_type) = (4 * (v160 & 7)) | BYTE1(this->attrib_type) & 0xE3 | 2; HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); return; case 2: v68 = v146; qword28_5 = (_QWORD *)operator new(0x18u); qword28_3 = qword28_5; *qword28_5 = 0; qword28_5[1] = 0; qword28_5[2] = 0; if ( v68 ) { if ( v68 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n_3 = 8 * v68; s_1 = (char *)operator new(n_3); v73 = &s_1[n_3]; *qword28_3 = s_1; s_4 = s_1; qword28_3[2] = &s_1[n_3]; memset(s_1, 0, n_3); LODWORD(qword48_5) = v146; qword28_3[1] = v73; this->qword28 = qword28_3; if ( (int)qword48_5 > 0 ) { v125 = 0; if ( n_3 ) { v123 = 0; while ( 1 ) { *(_QWORD *)&s_4[8 * v125] = *(_QWORD *)(v147 + 8LL * v123 + 8); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]( (__int64)s1_5, this, v123, (unsigned int)v123, qword48_5, v75); qword48_5 = this->qword48; if ( !qword48_5 ) { p_char40_2 = (char *)&this->qword40; goto LABEL_153; } n_15 = s1_5[1]; s2_2 = (__int64 *)s1_5[0]; qword48_1 = this->qword48; p_char40_2 = (char *)&this->qword40; do { while ( 1 ) { n_16 = *(_QWORD *)(qword48_1 + 40); n_4 = (size_t)n_15; if ( n_16 <= (unsigned __int64)n_15 ) n_4 = *(_QWORD *)(qword48_1 + 40); if ( !n_4 ) break; v81 = memcmp(*(const void **)(qword48_1 + 32), s2_2, n_4); if ( !v81 ) break; if ( v81 < 0 ) goto LABEL_93; LABEL_86: p_char40_2 = (char *)qword48_1; qword48_1 = *(_QWORD *)(qword48_1 + 16); if ( !qword48_1 ) goto LABEL_94; } n0x7FFFFFFF_1 = n_16 - (_QWORD)n_15; if ( n0x7FFFFFFF_1 > 0x7FFFFFFF || n0x7FFFFFFF_1 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_1 >= 0 ) { goto LABEL_86; } LABEL_93: qword48_1 = *(_QWORD *)(qword48_1 + 24); } while ( qword48_1 ); LABEL_94: if ( p_char40_2 == (char *)&this->qword40 ) goto LABEL_153; n_17 = *((_QWORD *)p_char40_2 + 5); n_5 = (size_t)n_15; if ( n_17 <= (unsigned __int64)n_15 ) n_5 = *((_QWORD *)p_char40_2 + 5); if ( n_5 && (n_18 = *((_QWORD *)p_char40_2 + 5), v87 = memcmp(s2_2, *((const void **)p_char40_2 + 4), n_5), n_17 = n_18, v87) ) { if ( v87 >= 0 ) goto LABEL_100; LABEL_153: s1_2 = s1_5; p_char40_3 = sub_F187E0(&this->qword38, p_char40_2, &s1_2); s2_2 = (__int64 *)s1_5[0]; } else { p_char40_3 = (__int64)p_char40_2; v75 = (signed __int64)n_15 - n_17; if ( (__int64)((__int64)n_15 - n_17) <= 0x7FFFFFFF ) { if ( v75 < (__int64)0xFFFFFFFF80000000LL || (int)v75 < 0 ) goto LABEL_153; LABEL_100: p_char40_3 = (__int64)p_char40_2; } } *(_WORD *)(p_char40_3 + 64) = v123; if ( s2_2 != &v138 ) operator delete(s2_2); if ( v146 <= ++v123 ) goto LABEL_157; qword28_4 = (char **)this->qword28; ++v125; s_4 = *qword28_4; v90 = (qword28_4[1] - *qword28_4) >> 3; if ( v90 <= v125 ) { v91 = v125; goto LABEL_167; } } } LABEL_166: v91 = 0; v90 = 0; LABEL_167: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v91, v90); } } else { v120 = v146; qword28_5[2] = 0; qword28_5[1] = 0; this->qword28 = qword28_5; if ( v120 > 0 ) goto LABEL_166; } LABEL_157: this->qword30 = qword30; goto LABEL_7; case 3: v37 = v148; qword28_10 = operator new(0x28u); *(_QWORD *)qword28_10 = 0; *(_DWORD *)(qword28_10 + 8) = 0; *(_QWORD *)(qword28_10 + 16) = 0; *(_DWORD *)(qword28_10 + 24) = 0; qword28_6 = qword28_10; *(_QWORD *)(qword28_10 + 32) = 0; n_6 = 8 * ((unsigned __int64)(v37 + 63) >> 6); s_2 = (char *)operator new(n_6); *(_QWORD *)qword28_6 = s_2; v44 = v37 + 63; *(_DWORD *)(qword28_6 + 8) = 0; *(_QWORD *)(qword28_6 + 32) = &s_2[n_6]; if ( v37 >= 0 ) v44 = v37; v45 = &s_2[8 * (v44 >> 6)]; v46 = v37 % 64; if ( v46 < 0 ) { v46 += 64; v45 -= 8; } *(_QWORD *)(qword28_6 + 16) = v45; *(_DWORD *)(qword28_6 + 24) = v46; if ( s_2 != &s_2[n_6] ) memset(s_2, 0, n_6); v47 = v148; this->qword28 = qword28_6; if ( v47 <= 0 ) goto LABEL_141; v48 = *(_BYTE *)(v149 + 8); if ( !(v46 + 8 * (v45 - s_2)) ) { v67 = 0; v66 = 0; LABEL_172: std::__throw_out_of_range_fmt( "vector<bool>::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v67, v66); } v122 = 0; LABEL_51: v49 = (__int64 *)&s_2[8 * (v122 >> 6)]; v50 = 1LL << v122; if ( v48 ) v51 = *v49 | v50; else v51 = *v49 & ~v50; *v49 = v51; HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s1, this, v122, v122, qword48_6, v43); qword48_6 = this->qword48; if ( !qword48_6 ) { p_char40_4 = (char *)&this->qword40; goto LABEL_138; } n_19 = s1[1]; s2_3 = (__int64 *)s1[0]; qword48_2 = this->qword48; p_char40_4 = (char *)&this->qword40; while ( 1 ) { while ( 1 ) { n_20 = *(_QWORD *)(qword48_2 + 40); n_7 = (size_t)n_19; if ( n_20 <= (unsigned __int64)n_19 ) n_7 = *(_QWORD *)(qword48_2 + 40); if ( n_7 ) { v56 = memcmp(*(const void **)(qword48_2 + 32), s2_3, n_7); if ( v56 ) break; } n0x7FFFFFFF_2 = n_20 - (_QWORD)n_19; if ( n0x7FFFFFFF_2 > 0x7FFFFFFF || n0x7FFFFFFF_2 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_2 >= 0 ) goto LABEL_57; LABEL_64: qword48_2 = *(_QWORD *)(qword48_2 + 24); if ( !qword48_2 ) { LABEL_65: if ( &this->qword40 == (_QWORD *)p_char40_4 ) goto LABEL_138; n_21 = *((_QWORD *)p_char40_4 + 5); n_8 = (size_t)n_19; if ( n_21 <= (unsigned __int64)n_19 ) n_8 = *((_QWORD *)p_char40_4 + 5); if ( n_8 && (n_22 = *((_QWORD *)p_char40_4 + 5), v62 = memcmp(s2_3, *((const void **)p_char40_4 + 4), n_8), n_21 = n_22, v62) ) { if ( v62 >= 0 ) goto LABEL_71; LABEL_138: s1_3 = s1; p_char40_5 = sub_F187E0(&this->qword38, p_char40_4, &s1_3); s2_3 = (__int64 *)s1[0]; } else { p_char40_5 = (__int64)p_char40_4; v43 = (signed __int64)n_19 - n_21; if ( (__int64)((__int64)n_19 - n_21) <= 0x7FFFFFFF ) { if ( v43 < (__int64)0xFFFFFFFF80000000LL || (int)v43 < 0 ) goto LABEL_138; LABEL_71: p_char40_5 = (__int64)p_char40_4; } } *(_WORD *)(p_char40_5 + 64) = v122; if ( s2_3 != &v140 ) operator delete(s2_3); v64 = v122 + 1; if ( v148 <= (int)v122 + 1 ) { LABEL_141: LOBYTE(this->qword30) = v159; goto LABEL_7; } ++v122; v48 = *(_BYTE *)(v149 + v64 + 8); qword28_7 = (char **)this->qword28; s_2 = *qword28_7; v66 = *((unsigned int *)qword28_7 + 6) + 8 * (qword28_7[2] - *qword28_7) - *((unsigned int *)qword28_7 + 2); if ( v122 >= v66 ) { v67 = v122; goto LABEL_172; } goto LABEL_51; } } if ( v56 < 0 ) goto LABEL_64; LABEL_57: p_char40_4 = (char *)qword48_2; qword48_2 = *(_QWORD *)(qword48_2 + 16); if ( !qword48_2 ) goto LABEL_65; } case 4: case 5: case 6: v9 = v150; v121 = v150; qword28_8 = (_QWORD *)operator new(0x18u); *qword28_8 = 0; qword28_8[1] = 0; qword28_8[2] = 0; if ( v9 ) { if ( v9 > 0x7FFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v11 = 32 * v121; v12 = operator new(32 * v121); v13 = v12 + 32 * v121; v14 = v12; *qword28_8 = v12; qword28_8[1] = v12; v15 = v121; qword28_8[2] = v13; do { if ( v12 ) { *(_QWORD *)(v12 + 8) = 0; *(_BYTE *)(v12 + 16) = 0; *(_QWORD *)v12 = v12 + 16; } v12 += 32; --v15; } while ( v15 ); v16 = v150; v121 = 0; qword28_8[1] = v13; this->qword28 = qword28_8; if ( v16 > 0 ) { v17 = *(_QWORD *)(v151 + 8); if ( v11 ) { while ( 1 ) { std::string::_M_assign(32 * v121 + v14, v17); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s2, this, v121, v18, v19, v20); if ( !this->qword48 ) { p_char40_6 = (char *)&this->qword40; goto LABEL_145; } n_23 = s2[1]; s2_4 = (char *)s2[0]; qword48_3 = this->qword48; p_char40_6 = (char *)&this->qword40; do { while ( 1 ) { n_24 = *(_QWORD *)(qword48_3 + 40); n_9 = (size_t)n_23; if ( n_24 <= (unsigned __int64)n_23 ) n_9 = *(_QWORD *)(qword48_3 + 40); if ( !n_9 ) break; v25 = memcmp(*(const void **)(qword48_3 + 32), s2_4, n_9); if ( !v25 ) break; if ( v25 < 0 ) goto LABEL_29; LABEL_22: p_char40_6 = (char *)qword48_3; qword48_3 = *(_QWORD *)(qword48_3 + 16); if ( !qword48_3 ) goto LABEL_30; } n0x7FFFFFFF_3 = n_24 - (_QWORD)n_23; if ( n0x7FFFFFFF_3 > 0x7FFFFFFF || n0x7FFFFFFF_3 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_3 >= 0 ) { goto LABEL_22; } LABEL_29: qword48_3 = *(_QWORD *)(qword48_3 + 24); } while ( qword48_3 ); LABEL_30: if ( p_char40_6 == (char *)&this->qword40 ) goto LABEL_145; n_25 = *((_QWORD *)p_char40_6 + 5); n_10 = (size_t)n_23; if ( n_25 <= (unsigned __int64)n_23 ) n_10 = *((_QWORD *)p_char40_6 + 5); if ( n_10 && (n_26 = *((_QWORD *)p_char40_6 + 5), v31 = memcmp(s2_4, *((const void **)p_char40_6 + 4), n_10), n_25 = n_26, v31) ) { if ( v31 >= 0 ) goto LABEL_36; LABEL_145: s2_5 = s2; p_char40_7 = sub_F187E0(&this->qword38, p_char40_6, &s2_5); s2_4 = (char *)s2[0]; } else { p_char40_7 = (__int64)p_char40_6; v117 = (signed __int64)n_23 - n_25; if ( (__int64)((__int64)n_23 - n_25) <= 0x7FFFFFFF ) { if ( v117 < (__int64)0xFFFFFFFF80000000LL || (int)v117 < 0 ) goto LABEL_145; LABEL_36: p_char40_7 = (__int64)p_char40_6; } } *(_WORD *)(p_char40_7 + 64) = v121; if ( s2_4 != &v142 ) operator delete(s2_4); v33 = v121 + 1; if ( v150 <= (int)v121 + 1 ) goto LABEL_6; ++v121; v17 = *(_QWORD *)(v151 + 8LL * v33 + 8); qword28_9 = (__int64 *)this->qword28; v14 = *qword28_9; v35 = (qword28_9[1] - *qword28_9) >> 5; if ( v35 <= v121 ) { v36 = v121; goto LABEL_161; } } } LABEL_160: v36 = v121; v35 = 0; LABEL_161: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v36, v35); } } else { v118 = v150; qword28_8[2] = 0; qword28_8[1] = 0; this->qword28 = qword28_8; if ( v118 > 0 ) goto LABEL_160; } LABEL_6: v7 = v153; qword30_1 = (_QWORD *)operator new(0x20u); *qword30_1 = qword30_1 + 2; sub_F12340(qword30_1, *v7, v7[1] + *v7); this->qword30 = qword30_1; goto LABEL_7; default: goto LABEL_7; } } 将函数中的 _BYTE attrib_msg[16] 映射为 HDDMXng::BelUsageAttrib attrib_msg void __fastcall HDDMBelUsageAttrib::writeme_pb(HDDMBelUsageAttrib *this, std::ostream *fileName) { unsigned __int8 attrib_code_high; // dl int v4; // eax int v5; // ecx int v6; // eax char v7; // cl int v8; // esi __int16 attrib_code; // ax int v10; // ecx unsigned __int16 v11; // ax _QWORD *p_attrib_name; // rsi const google::protobuf::Message *v13; // rdx __int64 qword30_2; // xmm0_8 unsigned __int8 v15; // al __int64 *qword28_6; // rax __int64 v17; // r12 __int64 v18; // rax __int64 v19; // r15 unsigned __int64 v20; // r13 int v21; // esi google::protobuf::Arena *v22; // r14 _QWORD *v23; // rax _QWORD *v24; // rbx _QWORD *v25; // rdi __int64 v26; // rax __int64 *qword28_7; // rax unsigned __int64 v28; // rdx _DWORD *v29; // rdx __int64 v30; // r12 __int64 v31; // rcx int v32; // eax __int64 *qword28_4; // rax __int64 v34; // rsi __int64 v35; // rcx __int64 v36; // r13 unsigned __int64 v37; // rbx __int64 *qword28_5; // rax unsigned __int64 v39; // rdx __int64 n4_21; // rax bool v41; // r12 _QWORD *v42; // r15 int n4_8; // edx google::protobuf::Arena *v44; // rdi int n4_7; // eax unsigned __int64 v46; // rdx size_t n; // rdx __int64 n4_12; // rcx __int64 *qword28_2; // rcx __int64 v50; // rax __int64 v51; // rcx __int64 v52; // r13 unsigned __int64 v53; // rbx __int64 *qword28_3; // rdx unsigned __int64 v55; // rdx __int64 v56; // xmm1_8 __int64 n4_19; // rax _QWORD *v58; // r14 int n4_4; // r12d google::protobuf::Arena *v60; // r15 unsigned __int64 v61; // rdx __int64 n4_18; // rax __int64 n4_6; // r15 __int64 *voidVec; // rcx __int64 v65; // rax __int64 v66; // rcx __int64 v67; // r14 unsigned __int64 v68; // rbx __int64 *qword28_1; // rdx unsigned __int64 v70; // rdx int v71; // r12d __int64 n4_16; // rax _QWORD *Aligned_1; // r15 int n4; // r13d google::protobuf::Arena *v75; // rdi unsigned __int64 v76; // rdx __int64 n4_15; // rax __int64 n4_2; // rcx char qword30_4; // al int voidVec1; // eax __int64 qword30_6; // rsi __int64 v82; // rax int n4_11; // eax _QWORD *v84; // rax google::protobuf::internal::RepeatedPtrFieldBase *v85; // [rsp+0h] [rbp-108h] int n4_13; // [rsp+0h] [rbp-108h] google::protobuf::internal::RepeatedPtrFieldBase *v87; // [rsp+0h] [rbp-108h] int n4_3; // [rsp+0h] [rbp-108h] int n4_9; // [rsp+1Ch] [rbp-ECh] _BYTE attrib_msg[16]; // [rsp+20h] [rbp-E8h] BYREF int v92; // [rsp+30h] [rbp-D8h] int n4_14; // [rsp+38h] [rbp-D0h] int n4_1; // [rsp+3Ch] [rbp-CCh] void *Aligned; // [rsp+40h] [rbp-C8h] int n4_17; // [rsp+50h] [rbp-B8h] int n4_5; // [rsp+54h] [rbp-B4h] void *v98; // [rsp+58h] [rbp-B0h] int n4_20; // [rsp+68h] [rbp-A0h] int n4_10; // [rsp+6Ch] [rbp-9Ch] void *v101; // [rsp+70h] [rbp-98h] google::protobuf::Arena *v102; // [rsp+80h] [rbp-88h] BYREF int v103; // [rsp+88h] [rbp-80h] int v104; // [rsp+8Ch] [rbp-7Ch] _DWORD *v105; // [rsp+90h] [rbp-78h] void *p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx; // [rsp+98h] [rbp-70h] BYREF void *p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1; // [rsp+A0h] [rbp-68h] BYREF int v108; // [rsp+A8h] [rbp-60h] int v109; // [rsp+ACh] [rbp-5Ch] int v110; // [rsp+B0h] [rbp-58h] int qword30_1; // [rsp+B4h] [rbp-54h] __int64 qword30_3; // [rsp+B8h] [rbp-50h] char qword30_5; // [rsp+C0h] [rbp-48h] int v114; // [rsp+C4h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(fileName, "BELUSAGEATTRIB", 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); attrib_code_high = HIBYTE(this->attrib_flags); v4 = attrib_code_high & 1; v5 = (_BYTE)v4 == 0 ? 4 : 6; v6 = (v4 << 31 >> 31) & 2; if ( (attrib_code_high & 2) != 0 ) v6 = v5; if ( (attrib_code_high & 4) != 0 ) v6 |= 8u; if ( (attrib_code_high & 0x40) != 0 ) v6 |= 0x10u; v7 = BYTE1(this->attrib_type); if ( (v7 & 0x20) != 0 ) v6 |= 0x20u; if ( (v7 & 0x40) != 0 ) v6 |= 0x40u; v8 = v6; if ( v7 < 0 ) { LOBYTE(v8) = v6 | 0x80; v6 = v8; } v108 = v6; attrib_code = this->attrib_flags; v109 = (attrib_code_high >> 3) & 7; v10 = v92 | 0xC; v11 = attrib_code & 0xFFF; if ( v11 ) { v10 = v92 | 0x1C; v110 = v11; } p_attrib_name = &this->attrib_name; v92 = v10 | 1; if ( p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx == &google::protobuf::internal::fixed_address_empty_string[abi:cxx11] ) sub_E76770(&p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx, p_attrib_name); else std::string::_M_assign(p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx, p_attrib_name); v13 = (const google::protobuf::Message *)HIBYTE(this->attrib_flags); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: voidVec = (__int64 *)this->qword28; if ( !voidVec ) goto LABEL_102; v65 = *voidVec; v66 = (voidVec[1] - *voidVec) >> 2; if ( (int)v66 <= 0 ) goto LABEL_102; if ( !v66 ) { v70 = 0; v68 = 0; LABEL_140: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v68, v70); } v67 = (unsigned int)(v66 - 1); v68 = 0; while ( 2 ) { v71 = *(_DWORD *)(v65 + 4 * v68); n4_16 = n4_14; if ( n4_14 != n4_1 ) goto LABEL_83; Aligned_1 = Aligned; n4 = n4_14 + 1; if ( Aligned ) { v75 = *(google::protobuf::Arena **)Aligned; if ( 2 * n4_14 >= n4 ) n4 = 2 * n4_14; v87 = *(google::protobuf::internal::RepeatedPtrFieldBase **)Aligned; if ( n4 < 4 ) n4 = 4; v76 = 4LL * n4 + 8; if ( v75 ) { Aligned = (void *)google::protobuf::Arena::AllocateAligned(v75, (const type_info *)&`typeinfo for'char, v76); *(_QWORD *)Aligned = v87; n4_15 = n4_14; n4_2 = n4_1; n4_1 = n4; if ( n4_14 <= 0 ) goto LABEL_95; goto LABEL_93; } } else { if ( 2 * n4_14 >= n4 ) n4 = 2 * n4_14; if ( n4 < 4 ) n4 = 4; v76 = 4LL * n4 + 8; } Aligned = (void *)operator new(v76); *(_QWORD *)Aligned = 0; n4_15 = n4_14; n4_2 = n4_1; n4_1 = n4; if ( n4_14 > 0 ) { LABEL_93: n4_3 = n4_2; memcpy((char *)Aligned + 8, Aligned_1 + 1, 4 * n4_15); n4_2 = n4_3; } if ( !Aligned_1 ) goto LABEL_97; LABEL_95: if ( !*Aligned_1 ) operator delete(Aligned_1, 4 * n4_2 + 8); LABEL_97: n4_16 = n4_14; LABEL_83: n4_14 = n4_16 + 1; *((_DWORD *)Aligned + n4_16 + 2) = v71; if ( v68 != v67 ) { qword28_1 = (__int64 *)this->qword28; ++v68; v65 = *qword28_1; v70 = (qword28_1[1] - *qword28_1) >> 2; if ( v70 <= v68 ) goto LABEL_140; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_102: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { voidVec1 = this->qword30; v92 |= 0x20u; qword30_1 = voidVec1; } goto LABEL_25; case 2: qword28_2 = (__int64 *)this->qword28; if ( !qword28_2 ) goto LABEL_21; v50 = *qword28_2; v51 = (qword28_2[1] - *qword28_2) >> 3; if ( (int)v51 <= 0 ) goto LABEL_21; if ( !v51 ) { v55 = 0; v53 = 0; LABEL_138: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v53, v55); } v52 = (unsigned int)(v51 - 1); v53 = 0; while ( 2 ) { v56 = *(_QWORD *)(v50 + 8 * v53); n4_19 = n4_17; if ( n4_17 != n4_5 ) goto LABEL_64; v58 = v98; n4_4 = n4_17 + 1; if ( v98 ) { v60 = *(google::protobuf::Arena **)v98; if ( 2 * n4_17 >= n4_4 ) n4_4 = 2 * n4_17; if ( n4_4 < 4 ) n4_4 = 4; v61 = 8LL * n4_4 + 8; if ( v60 ) { v98 = (void *)google::protobuf::Arena::AllocateAligned( *(google::protobuf::Arena **)v98, (const type_info *)&`typeinfo for'char, v61); *(_QWORD *)v98 = v60; n4_18 = n4_17; n4_6 = n4_5; n4_5 = n4_4; if ( n4_17 <= 0 ) goto LABEL_76; goto LABEL_74; } } else { if ( 2 * n4_17 >= n4_4 ) n4_4 = 2 * n4_17; if ( n4_4 < 4 ) n4_4 = 4; v61 = 8LL * n4_4 + 8; } v98 = (void *)operator new(v61); *(_QWORD *)v98 = 0; n4_18 = n4_17; n4_6 = n4_5; n4_5 = n4_4; if ( n4_17 > 0 ) LABEL_74: memcpy((char *)v98 + 8, v58 + 1, 8 * n4_18); if ( !v58 ) goto LABEL_78; LABEL_76: if ( !*v58 ) operator delete(v58, 8 * n4_6 + 8); LABEL_78: n4_19 = n4_17; LABEL_64: n4_17 = n4_19 + 1; *((_QWORD *)v98 + n4_19 + 1) = v56; if ( v53 != v52 ) { qword28_3 = (__int64 *)this->qword28; ++v53; v50 = *qword28_3; v55 = (qword28_3[1] - *qword28_3) >> 3; if ( v53 >= v55 ) goto LABEL_138; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_21: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword30_2 = this->qword30; v92 |= 0x40u; qword30_3 = qword30_2; } v15 = BYTE1(this->attrib_type); if ( (v15 & 2) != 0 ) { v92 |= 0x100u; v114 = (v15 >> 2) & 7; } goto LABEL_25; case 3: qword28_4 = (__int64 *)this->qword28; if ( !qword28_4 ) goto LABEL_99; v34 = *qword28_4; v35 = *((unsigned int *)qword28_4 + 6) + 8 * (qword28_4[2] - *qword28_4) - *((unsigned int *)qword28_4 + 2); if ( (int)v35 <= 0 ) goto LABEL_99; if ( !v35 ) { v39 = 0; v37 = 0; LABEL_136: std::__throw_out_of_range_fmt( "vector<bool>::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v37, v39); } v36 = (unsigned int)(v35 - 1); v37 = 0; while ( 2 ) { n4_21 = n4_20; v41 = ((1LL << v37) & *(_QWORD *)(v34 + 8 * (v37 >> 6))) != 0; if ( n4_20 != n4_10 ) goto LABEL_45; v42 = v101; n4_8 = n4_20 + 1; if ( v101 ) { v44 = *(google::protobuf::Arena **)v101; if ( 2 * n4_20 >= n4_8 ) n4_8 = 2 * n4_20; n4_7 = 4; v85 = *(google::protobuf::internal::RepeatedPtrFieldBase **)v101; if ( n4_8 >= 4 ) n4_7 = n4_8; n4_9 = n4_7; v46 = n4_7 + 8LL; if ( v44 ) { v101 = (void *)google::protobuf::Arena::AllocateAligned(v44, (const type_info *)&`typeinfo for'char, v46); *(_QWORD *)v101 = v85; n = n4_20; n4_12 = n4_10; n4_10 = n4_9; if ( n4_20 <= 0 ) goto LABEL_57; goto LABEL_55; } } else { if ( 2 * n4_20 >= n4_8 ) n4_8 = 2 * n4_20; n4_11 = 4; if ( n4_8 >= 4 ) n4_11 = n4_8; n4_9 = n4_11; v46 = n4_11 + 8LL; } v84 = (_QWORD *)operator new(v46); n = n4_20; v101 = v84; *v84 = 0; n4_12 = n4_10; n4_10 = n4_9; if ( (int)n > 0 ) { LABEL_55: n4_13 = n4_12; memcpy((char *)v101 + 8, v42 + 1, n); n4_12 = n4_13; } if ( !v42 ) goto LABEL_59; LABEL_57: if ( !*v42 ) operator delete(v42, n4_12 + 8); LABEL_59: n4_21 = n4_20; LABEL_45: n4_20 = n4_21 + 1; *((_BYTE *)v101 + n4_21 + 8) = v41; if ( v36 != v37 ) { qword28_5 = (__int64 *)this->qword28; ++v37; v34 = *qword28_5; v39 = *((unsigned int *)qword28_5 + 6) + 8 * (qword28_5[2] - *qword28_5) - *((unsigned int *)qword28_5 + 2); if ( v39 <= v37 ) goto LABEL_136; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_99: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword30_4 = this->qword30; v92 |= 0x80u; qword30_5 = qword30_4; } LABEL_25: HDDMDevice::writeMessage((HDDMDevice *)fileName, (std::ostream *)attrib_msg, v13); HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); return; case 4: case 5: case 6: qword28_6 = (__int64 *)this->qword28; if ( !qword28_6 ) goto LABEL_105; v17 = *qword28_6; v18 = (qword28_6[1] - *qword28_6) >> 5; if ( (int)v18 <= 0 ) goto LABEL_105; if ( !v18 ) { v28 = 0; v20 = 0; LABEL_134: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v20, v28); } v19 = (unsigned int)(v18 - 1); v20 = 0; while ( 2 ) { v29 = v105; v21 = v104; v30 = 32 * v20 + v17; if ( !v105 ) goto LABEL_108; v31 = v103; v32 = *v105; if ( v103 >= *v105 ) { v21 = v104; if ( v32 == v104 ) { LABEL_108: google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v102, v21 + 1); v29 = v105; v32 = *v105; } *v29 = v32 + 1; v22 = v102; if ( v102 ) { v23 = (_QWORD *)google::protobuf::Arena::AllocateAligned( v102, (const type_info *)&`typeinfo for'std::string, 0x20u); v24 = v23; if ( v23 ) { v23[1] = 0; *((_BYTE *)v23 + 16) = 0; *v23 = v23 + 2; } google::protobuf::Arena::AddListNode( v22, v23, (void (*)(void *))google::protobuf::internal::arena_destruct_object<std::string>); v25 = v24; } else { v82 = operator new(0x20u); *(_QWORD *)(v82 + 8) = 0; *(_BYTE *)(v82 + 16) = 0; v25 = (_QWORD *)v82; *(_QWORD *)v82 = v82 + 16; } v26 = v103++; *(_QWORD *)&v105[2 * v26 + 2] = v25; } else { ++v103; v25 = *(_QWORD **)&v105[2 * v31 + 2]; } std::string::_M_assign(v25, v30); if ( v20 != v19 ) { qword28_7 = (__int64 *)this->qword28; ++v20; v17 = *qword28_7; v28 = (qword28_7[1] - *qword28_7) >> 5; if ( v28 <= v20 ) goto LABEL_134; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_105: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { v92 |= 2u; qword30_6 = this->qword30; if ( p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1 == &google::protobuf::internal::fixed_address_empty_string[abi:cxx11] ) sub_E76770(&p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1, qword30_6); else std::string::_M_assign(p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1, qword30_6); } goto LABEL_25; default: goto LABEL_25; } } void __fastcall HDDMBelUsageAttrib::print(HDDMBelUsageAttrib *this, std::ostream *stream, std::string *filename) { char attrib_code_high; // al char v6; // al char n7; // al const char *unknown; // r15 __int64 v9; // r14 size_t v10; // rax __int64 v11; // r14 __int64 v12; // r14 size_t v13; // rax __int64 v14; // rax char v15; // al unsigned __int16 v16; // r14 unsigned __int8 v17; // si char n2; // al _QWORD *qword28_4; // rdx _QWORD *v20; // rax _QWORD *v21; // r13 _QWORD *qword30_1; // rbx char *_[MISMATCH]_2; // rax char *_[MISMATCH]_1; // rax char *_[MISMATCH]; // rax __int64 v26; // rax __int64 v27; // rax __int64 v28; // rax __int64 v29; // rax double **qword28_5; // rdx double *v31; // rax double *v32; // r13 unsigned int **qword28_3; // rdx unsigned int *v34; // rax unsigned int *v35; // r13 unsigned int voidVec1; // ebx __int64 voidVec; // rax _QWORD *v38; // r14 unsigned int n63; // r13d _QWORD *v40; // rcx int n63_1; // edx __int64 qword28_1; // rax __int64 qword28_2; // rax unsigned int voidVec1_low; // ebx char *s; // [rsp+8h] [rbp-60h] char *sa; // [rsp+8h] [rbp-60h] void *v47[2]; // [rsp+10h] [rbp-58h] BYREF _BYTE v48[72]; // [rsp+20h] [rbp-48h] BYREF v47[0] = v48; sub_F12340(v47, "", ""); if ( (this->attrib_flags & 0xFFF) != 0 ) std::string::append(v47, "W"); attrib_code_high = HIBYTE(this->attrib_flags); if ( (attrib_code_high & 4) != 0 ) { std::string::append(v47, "G"); attrib_code_high = HIBYTE(this->attrib_flags); } if ( (attrib_code_high & 0x40) != 0 ) std::string::append(v47, "E"); v6 = BYTE1(this->attrib_type); if ( (v6 & 2) != 0 ) { std::string::append(v47, "P"); v6 = BYTE1(this->attrib_type); } if ( (v6 & 0x40) != 0 ) { std::string::append(v47, "H"); if ( (this->attrib_type & 0x8000) == 0 ) goto LABEL_11; } else if ( v6 >= 0 ) { LABEL_11: n7 = (HIBYTE(this->attrib_flags) >> 3) & 7; goto LABEL_12; } std::string::append(v47, "B"); n7 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n7 == 7 ) { LABEL_15: unknown = "unknown"; s = ""; goto LABEL_17; } LABEL_12: switch ( n7 ) { case 0: unknown = "unsigned"; s = ""; break; case 1: unknown = "int"; s = ""; break; case 2: _[MISMATCH] = ""; unknown = "double"; if ( (*(_QWORD *)&this->attrib_flags & 0xC00000000FFFLL) != 0 ) _[MISMATCH] = " [MISMATCH]"; s = _[MISMATCH]; break; case 3: unknown = "bool"; s = ""; break; case 4: unknown = "string"; s = ""; break; case 5: _[MISMATCH]_1 = ""; unknown = "bithex"; if ( (this->attrib_type & 0x8200) != 0 ) _[MISMATCH]_1 = " [MISMATCH]"; s = _[MISMATCH]_1; break; case 6: _[MISMATCH]_2 = ""; unknown = "bitbinary"; if ( (this->attrib_type & 0x4200) != 0 ) _[MISMATCH]_2 = " [MISMATCH]"; s = _[MISMATCH]_2; break; default: goto LABEL_15; } LABEL_17: v9 = std::__ostream_insert<char,std::char_traits<char>>(stream, *(_QWORD *)filename, *((_QWORD *)filename + 1)); v10 = strlen(unknown); std::__ostream_insert<char,std::char_traits<char>>(v9, unknown, v10); std::__ostream_insert<char,std::char_traits<char>>(v9, "[", 1); v11 = std::__ostream_insert<char,std::char_traits<char>>(v9, v47[0], v47[1]); std::__ostream_insert<char,std::char_traits<char>>(v11, "] ", 2); v12 = std::__ostream_insert<char,std::char_traits<char>>(v11, this->attrib_name, this->attribVoidVec); v13 = strlen(s); std::__ostream_insert<char,std::char_traits<char>>(v12, s, v13); std::endl<char,std::char_traits<char>>(v12); v14 = std::__ostream_insert<char,std::char_traits<char>>(stream, *(_QWORD *)filename, *((_QWORD *)filename + 1)); std::__ostream_insert<char,std::char_traits<char>>(v14, " ", 3); v15 = 0; if ( (this->attrib_flags & 0x2000000) != 0 ) { std::operator<<<std::char_traits<char>>(stream, " (HIDDEN=true)"); v15 = 1; } v16 = this->attrib_flags & 0xFFF; if ( v16 ) { std::__ostream_insert<char,std::char_traits<char>>(stream, " (Width=", 8); v26 = std::ostream::_M_insert<unsigned long>(stream, v16); std::operator<<<std::char_traits<char>>(v26, ")"); v17 = BYTE1(this->attrib_type); if ( (v17 & 2) == 0 ) goto LABEL_49; goto LABEL_48; } v17 = BYTE1(this->attrib_type); if ( (v17 & 2) != 0 ) { LABEL_48: std::__ostream_insert<char,std::char_traits<char>>(stream, " (percision=", 12); v27 = std::ostream::_M_insert<unsigned long>(stream, (v17 >> 2) & 7); std::operator<<<std::char_traits<char>>(v27, ")"); goto LABEL_49; } if ( !v15 ) { n2 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n2 != 2 ) goto LABEL_23; goto LABEL_50; } LABEL_49: v28 = std::endl<char,std::char_traits<char>>(stream); v29 = std::__ostream_insert<char,std::char_traits<char>>(v28, *(_QWORD *)filename, *((_QWORD *)filename + 1)); std::operator<<<std::char_traits<char>>(v29, " "); n2 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n2 != 2 ) { LABEL_23: if ( n2 == 3 ) { std::operator<<<std::char_traits<char>>(stream, " ( "); voidVec = this->qword28; if ( voidVec ) { v38 = *(_QWORD **)voidVec; n63 = *(_DWORD *)(voidVec + 8); v40 = *(_QWORD **)(voidVec + 16); n63_1 = *(_DWORD *)(voidVec + 24); while ( n63 != n63_1 || v38 != v40 ) { while ( 1 ) { std::ostream::_M_insert<bool>(stream, ((1LL << n63) & *v38) != 0); qword28_1 = this->qword28; v40 = *(_QWORD **)(qword28_1 + 16); n63_1 = *(_DWORD *)(qword28_1 + 24); if ( v40 != &v38[(n63 + 1LL) >> 6] || n63_1 != (((_BYTE)n63 + 1) & 0x3F) ) { std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); qword28_2 = this->qword28; n63_1 = *(_DWORD *)(qword28_2 + 24); v40 = *(_QWORD **)(qword28_2 + 16); } if ( n63 == 63 ) break; if ( ++n63 == n63_1 && v38 == v40 ) goto LABEL_74; } ++v38; n63 = 0; } } LABEL_74: if ( (this->attrib_flags & 0x1000000) != 0 ) { voidVec1_low = LOBYTE(this->qword30); std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::_M_insert<bool>(stream, voidVec1_low); } } else if ( n2 == 1 ) { std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_3 = (unsigned int **)this->qword28; if ( qword28_3 ) { v34 = qword28_3[1]; v35 = *qword28_3; while ( v35 != v34 ) { while ( 1 ) { std::ostream::operator<<(stream, *v35++); v34 = *(unsigned int **)(this->qword28 + 8LL); if ( v35 == v34 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v35 == *(unsigned int **)(this->qword28 + 8LL) ) goto LABEL_62; } } } LABEL_62: if ( (this->attrib_flags & 0x1000000) != 0 ) { voidVec1 = this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::operator<<(stream, voidVec1); } } else { std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_4 = (_QWORD *)this->qword28; if ( qword28_4 ) { v20 = (_QWORD *)qword28_4[1]; v21 = (_QWORD *)*qword28_4; while ( v21 != v20 ) { while ( 1 ) { std::__ostream_insert<char,std::char_traits<char>>(stream, *v21, v21[1]); v21 += 4; v20 = *(_QWORD **)(this->qword28 + 8LL); if ( v21 == v20 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v21 == *(_QWORD **)(this->qword28 + 8LL) ) goto LABEL_30; } } } LABEL_30: if ( (this->attrib_flags & 0x1000000) != 0 ) { qword30_1 = (_QWORD *)this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::__ostream_insert<char,std::char_traits<char>>(stream, *qword30_1, qword30_1[1]); } } goto LABEL_32; } LABEL_50: std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_5 = (double **)this->qword28; if ( qword28_5 ) { v31 = qword28_5[1]; v32 = *qword28_5; while ( v32 != v31 ) { while ( 1 ) { std::ostream::_M_insert<double>(stream, *v32++); v31 = *(double **)(this->qword28 + 8LL); if ( v32 == v31 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v32 == *(double **)(this->qword28 + 8LL) ) goto LABEL_55; } } } LABEL_55: if ( (this->attrib_flags & 0x1000000) != 0 ) { sa = (char *)this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::_M_insert<double>(stream, *(double *)&sa); } LABEL_32: std::operator<<<std::char_traits<char>>(stream, " ) "); if ( v47[0] != v48 ) operator delete(v47[0]); } void HDDMBelUsageAttrib::HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { __int16 word4; // ax word4 = this->attrib_type; LOWORD(this->attrib_flags) &= 0xF000u; BYTE2(this->attrib_type) &= 0xF0u; this->attribVoidVec = 0; this->attrib_flags |= 0xFFF000u; LOBYTE(this->qword18) = 0; HIBYTE(this->attrib_flags) = 0; LOWORD(this->attrib_type) = word4 & 0xFE00; BYTE1(this->attrib_type) = 0; HIWORD(this->attrib_type) |= 0xFFF0u; this->attrib_name = (char *)&this->qword18; LODWORD(this->qword40) = 0; this->qword48 = 0; *((_QWORD *)this + 12) = 0; *((_QWORD *)this + 10) = &this->qword40; *((_QWORD *)this + 11) = &this->qword40; this->qword30 = 0; this->qword28 = 0; } void HDDMBelUsageAttrib::~HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { char v2; // al void ***qword28_2; // r12 void **v4; // rbp void **v5; // rbx void **qword30; // rbx __int64 v7; // rax _QWORD *v8; // rdx _QWORD *v9; // r13 _QWORD *v10; // rbp unsigned __int64 v11; // r10 const char *v12; // rsi _QWORD *v13; // r8 _QWORD *v14; // rbx unsigned __int64 v15; // rcx _QWORD *_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins; // r15 unsigned __int64 v17; // rsi __int64 v18; // r10 unsigned __int64 v19; // rtt __int64 v20; // r11 unsigned __int64 v21; // r9 __int64 **v22; // rdx __int64 *i; // rcx __int64 *v24; // rdi __int64 v25; // r8 unsigned __int64 v26; // rdx void **qword28_1; // rbx __int64 qword48; // rsi _QWORD *p_qword38; // rdi _QWORD *p_qword18; // r14 _QWORD *p_qword18_1; // rdi unsigned __int64 v32; // rdx void **qword28; // rbx __int64 v34; // [rsp+8h] [rbp-50h] HDDMBelUsageAttrib *p_this; // [rsp+18h] [rbp-40h] BYREF v2 = (HIBYTE(this->attrib_flags) >> 3) & 7; switch ( v2 ) { case 2: goto LABEL_40; case 3: qword28 = (void **)this->qword28; if ( qword28 ) { if ( *qword28 ) operator delete(*qword28); operator delete(qword28, 0x28u); } goto LABEL_44; case 1: LABEL_40: qword28_1 = (void **)this->qword28; if ( qword28_1 ) { if ( *qword28_1 ) operator delete(*qword28_1); operator delete(qword28_1, 0x18u); } LABEL_44: this->qword28 = 0; goto LABEL_45; } qword28_2 = (void ***)this->qword28; if ( qword28_2 ) { v4 = qword28_2[1]; v5 = *qword28_2; if ( v4 != *qword28_2 ) { do { if ( *v5 != v5 + 2 ) operator delete(*v5); v5 += 4; } while ( v4 != v5 ); v5 = *qword28_2; } if ( v5 ) operator delete(v5); operator delete(qword28_2, 0x18u); this->qword28 = 0; } qword30 = (void **)this->qword30; if ( qword30 ) { if ( *qword30 != qword30 + 2 ) operator delete(*qword30); operator delete(qword30, 0x20u); this->qword30 = 0; p_this = this; if ( !*(_BYTE *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::observers() ) goto LABEL_46; goto LABEL_17; } LABEL_45: p_this = this; if ( !*(_BYTE *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::observers() ) goto LABEL_46; LABEL_17: if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_n2t_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache); } v7 = std::_Hashtable<HDDMBelUsageAttrib const*,std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>,std::allocator<std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>>,std::__detail::_Select1st,std::equal_to<HDDMBelUsageAttrib const*>,boost::hash<HDDMBelUsageAttrib const*>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<true,false,false>>::equal_range( hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache, &p_this); v34 = v7; v9 = v8; if ( (_QWORD *)v7 != v8 ) { v10 = (_QWORD *)v7; while ( 1 ) { if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); } v11 = v10[2]; v12 = (const char *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache[1]; v13 = *(_QWORD **)(*hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + 8 * ((v11 + (v11 >> 3)) % (unsigned __int64)v12)); if ( !v13 ) break; v14 = (_QWORD *)*v13; v15 = *(_QWORD *)(*v13 + 24LL); while ( v11 + (v10[2] >> 3) != v15 || v11 != v14[1] ) { if ( *v14 ) { v15 = *(_QWORD *)(*v14 + 24LL); v13 = v14; v14 = (_QWORD *)*v14; if ( (v11 + (v10[2] >> 3)) % (unsigned __int64)v12 == v15 % (unsigned __int64)v12 ) continue; } goto LABEL_26; } if ( !v13 || !v14 ) break; if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_29; if ( __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) goto LABEL_64; if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_30; LABEL_55: if ( __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); } LABEL_30: _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache; v17 = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache[1]; v18 = *hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache; v19 = v14[3]; v20 = 8 * (v19 % v17); v21 = v19 % v17; v22 = (__int64 **)(*hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + v20); for ( i = *v22; ; i = (__int64 *)*i ) { v24 = (__int64 *)*i; if ( (_QWORD *)*i == v14 ) break; } v25 = *v14; if ( *v22 != i ) { if ( v25 ) { v26 = *(_QWORD *)(v25 + 24) % v17; if ( v21 != v26 ) { *(_QWORD *)(v18 + 8 * v26) = i; v25 = *v14; } } goto LABEL_37; } if ( !v25 ) { if ( i == hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + 2 ) LABEL_67: _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins[2] = v25; LABEL_62: *v22 = 0; v25 = *v24; goto LABEL_37; } v32 = *(_QWORD *)(v25 + 24) % v17; if ( v21 != v32 ) { *(_QWORD *)(v18 + 8 * v32) = i; v22 = (__int64 **)(*_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins + v20); if ( *v22 == _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins + 2 ) goto LABEL_67; goto LABEL_62; } LABEL_37: *i = v25; operator delete(v24); --_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins[3]; hdi::tcltasks::native_cache_base::mark_invalid(v10[2]); hdi::tcltasks::native_cache_base::decr_refcount(v10[2]); v10 = (_QWORD *)*v10; if ( v9 == v10 ) { if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_n2t_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache); } std::_Hashtable<HDDMBelUsageAttrib const*,std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>,std::allocator<std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>>,std::__detail::_Select1st,std::equal_to<HDDMBelUsageAttrib const*>,boost::hash<HDDMBelUsageAttrib const*>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<true,false,false>>::erase( hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache, v34, v9); goto LABEL_46; } } LABEL_26: if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache || !__cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { goto LABEL_28; } v14 = 0; LABEL_64: hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); if ( !v14 ) { LABEL_28: v14 = 0; hdi::tcltasks::native_cache_base::error((hdi::tcltasks::native_cache_base *)"native_cache<> corrupt", v12); } LABEL_29: if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_30; goto LABEL_55; } LABEL_46: qword48 = this->qword48; p_qword38 = &this->qword38; p_qword18 = &this->qword18; std::_Rb_tree<std::string,std::pair<std::string const,unsigned short>,std::_Select1st<std::pair<std::string const,unsigned short>>,std::less<std::string>,std::allocator<std::pair<std::string const,unsigned short>>>::_M_erase( p_qword38, qword48); p_qword18_1 = (_QWORD *)*(p_qword18 - 2); if ( p_qword18_1 != p_qword18 ) operator delete(p_qword18_1); }
最新发布
10-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值