请仔细阅读和分析下面函数,保持函数原始逻辑功能不变, 不要遗漏逻辑细节,进行优化后,采用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.仔细解析 message BelDef 所有字段
5.将函数中 _BYTE beldef_msg[16] 映射为 HDDMXng::BelDef beldef_msg
__int64 __fastcall HDDMProto::readMessage(HDDMProto *this, std::istream *a2, google::protobuf::Message *a3)
{
HEXDataException *exception; // rbx
_QWORD *v7; // rax
unsigned int v8; // ebp
char *v9; // rdi
char *v10; // r8
__int64 v11; // r9
char *v12; // rsi
unsigned __int64 v13; // rax
__int64 result; // rax
unsigned __int64 v15; // r11
unsigned __int64 v16; // rdx
bool v17; // cf
unsigned __int64 v18; // rdx
char *v19; // rax
const void *v20; // rsi
char *v21; // r8
char *v22; // r10
size_t v23; // rdx
size_t v24; // r14
char *v25; // rdi
char *v26; // r14
char *v27; // r10
_QWORD *v28; // rax
_QWORD *v29; // rax
_QWORD *v30; // rax
size_t v31; // r14
char *v32; // r14
char *v33; // rax
_QWORD *v34; // rax
unsigned __int64 v35; // [rsp+0h] [rbp-78h]
unsigned __int64 v36; // [rsp+8h] [rbp-70h]
char *v37; // [rsp+8h] [rbp-70h]
char *v38; // [rsp+8h] [rbp-70h]
char *v39; // [rsp+8h] [rbp-70h]
char *v40; // [rsp+10h] [rbp-68h]
char *v41; // [rsp+10h] [rbp-68h]
unsigned __int64 v42; // [rsp+10h] [rbp-68h]
__int64 v43; // [rsp+18h] [rbp-60h]
__int64 v44; // [rsp+18h] [rbp-60h]
char v45; // [rsp+2Eh] [rbp-4Ah] BYREF
char v46; // [rsp+2Fh] [rbp-49h] BYREF
char v47[72]; // [rsp+30h] [rbp-48h] BYREF
if ( (*((_BYTE *)a2 + *(_QWORD *)(*(_QWORD *)a2 - 24LL) + 32) & 5) != 0 )
goto LABEL_2;
v7 = (_QWORD *)std::istream::get(a2, v47);
if ( (*((_BYTE *)v7 + *(_QWORD *)(*v7 - 24LL) + 32) & 5) != 0 )
goto LABEL_2;
v8 = v47[0] & 0x7F;
if ( v47[0] >= 0 )
goto LABEL_6;
v28 = (_QWORD *)std::istream::get(a2, v47);
if ( (*((_BYTE *)v28 + *(_QWORD *)(*v28 - 24LL) + 32) & 5) != 0 )
goto LABEL_2;
v8 |= (v47[0] & 0x7F) << 7;
if ( v47[0] >= 0 )
goto LABEL_6;
v29 = (_QWORD *)std::istream::get(a2, v47);
if ( (*((_BYTE *)v29 + *(_QWORD *)(*v29 - 24LL) + 32) & 5) != 0 )
{
LABEL_2:
exception = (HEXDataException *)__cxa_allocate_exception(0x18uLL);
std::string::string(v47, "HDDMProto::readMessage failed: bad length", &v45);
HEXDataException::HEXDataException(exception, (const std::string *)v47);
goto LABEL_3;
}
v8 |= (v47[0] & 0x7F) << 14;
if ( v47[0] < 0 )
{
v30 = (_QWORD *)std::istream::get(a2, v47);
if ( (*((_BYTE *)v30 + *(_QWORD *)(*v30 - 24LL) + 32) & 5) != 0 )
goto LABEL_2;
v8 |= (v47[0] & 0x7F) << 21;
if ( v47[0] < 0 )
{
v34 = (_QWORD *)std::istream::get(a2, v47);
if ( (*((_BYTE *)v34 + *(_QWORD *)(*v34 - 24LL) + 32) & 5) != 0 )
goto LABEL_2;
v8 |= (unsigned __int8)v47[0] << 28;
if ( v47[0] < 0 )
goto LABEL_2;
}
if ( v8 > 0x989680 )
{
exception = (HEXDataException *)__cxa_allocate_exception(0x18uLL);
std::string::string(v47, "HDDMProto::readMessage failed: crazy length", &v45);
HEXDataException::HEXDataException(exception, (const std::string *)v47);
goto LABEL_3;
}
}
LABEL_6:
v9 = (char *)*((_QWORD *)this + 1);
v10 = *(char **)this;
v11 = v8;
v12 = *(char **)this;
v13 = *((_QWORD *)this + 1) - *(_QWORD *)this;
if ( v8 <= v13 )
goto LABEL_7;
v15 = v8 - v13;
if ( v8 == v13 )
{
v12 = *(char **)this;
goto LABEL_7;
}
if ( v15 <= *((_QWORD *)this + 2) - (_QWORD)v9 )
{
v31 = v8 - v13;
memset(v9, 0, v31);
v32 = (char *)(*((_QWORD *)this + 1) + v31);
v12 = *(char **)this;
v11 = v8;
v10 = *(char **)this;
*((_QWORD *)this + 1) = v32;
v9 = v32;
goto LABEL_7;
}
if ( v15 > ~v13 )
std::__throw_length_error("vector::_M_default_append");
v16 = *((_QWORD *)this + 1) - *(_QWORD *)this;
v35 = -1LL;
if ( v15 >= v13 )
v16 = v8 - v13;
v17 = __CFADD__(v13, v16);
v18 = v13 + v16;
if ( !v17 )
{
if ( !v18 )
{
v20 = *(const void **)this;
v24 = *((_QWORD *)this + 1) - *(_QWORD *)this;
v23 = v24;
v21 = 0LL;
v35 = 0LL;
v22 = 0LL;
goto LABEL_18;
}
v35 = v18;
}
v36 = v8 - v13;
v19 = (char *)operator new(v35);
v20 = *(const void **)this;
v21 = v19;
v15 = v36;
v11 = v8;
v22 = v19;
v23 = *((_QWORD *)this + 1) - *(_QWORD *)this;
v24 = v23;
LABEL_18:
if ( v23 )
{
v44 = v11;
v42 = v15;
v39 = v21;
v33 = (char *)memmove(v22, v20, v24);
v11 = v44;
v15 = v42;
v22 = v33;
v21 = v39;
}
v25 = &v22[v24];
v43 = v11;
v40 = v21;
v37 = v22;
v26 = &v22[v24 + v15];
memset(v25, 0, v26 - v25);
v27 = v37;
v10 = v40;
v11 = v43;
if ( *(_QWORD *)this )
{
v41 = v37;
v38 = v10;
operator delete(*(void **)this);
v11 = v43;
v27 = v41;
v10 = v38;
}
*(_QWORD *)this = v27;
v9 = v26;
*((_QWORD *)this + 1) = v26;
v12 = v27;
*((_QWORD *)this + 2) = &v27[v35];
LABEL_7:
if ( v9 == v10 || (std::istream::read(a2, v12, v11), *((_QWORD *)this + 1) == *(_QWORD *)this) )
std::__throw_out_of_range("vector::_M_range_check");
result = google::protobuf::MessageLite::ParseFromArray(a3, *(const void **)this, v8);
if ( !(_BYTE)result )
{
exception = (HEXDataException *)__cxa_allocate_exception(0x18uLL);
std::string::string(v47, "HDDMProto::readMessage failed", &v45);
HEXDataException::HEXDataException(exception, (const std::string *)v47);
LABEL_3:
std::string::_Rep::_M_dispose(*(_QWORD *)v47 - 24LL, &v46);
__cxa_throw(exception, (struct type_info *)&`typeinfo for'HEXDataException, sub_1F4CF30);
}
return result;
}
__int64 __fastcall HDDMDevice::readMessage(HDDMDevice *this, std::istream *a2, google::protobuf::Message *a3)
{
return HDDMProto::readMessage((HDDMProto *)&qword_992E0F0, (std::istream *)this, a2);
}
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);
}
最新发布