不能将参数 1 从“int &(__thiscall RBTree<T>::* )(RBTreeNode<T> *)”转换为“int &(__cdecl *)(RBTreeNode<T> *)”

本文深入解析了C++成员函数的调用约定,包括thiscall和__cdecl两种方式的区别及用法。通过具体代码示例,详细解释了每个约定的工作原理和参数传递方式。

因为你需要的是一个类的函数地址而不是对象的。所以必需用静态成员函数。

static  int    implement(int x); //改成静态成员函数

或者友元也可以吧???


thiscall仅仅应用于“C++”成员函数。this指针存放于CX/ECX寄存器中,参数从右到左压。thiscall不是关键词,因此不能被程序员指定。 

__cdecl 
C调用约定(即用__cdecl关键字说明)(The C default calling convention)按从右至左的顺序压参数入栈,由调用者把参数弹出栈。对于传送参数的内存栈是由调用者来维护的(正因为如此,实现可变参数vararg的函数(如printf)只能使用该调用约定)。另外,在函数名修饰约定方面也有所不同。 _cdecl是C和C++程序的缺省调用方式。每一个调用它的函数都包含清空堆栈的代码,所以产生的可执行文件大小会比调用_stdcall函数的大。函数采用从右到左的压栈方式。VC将函数编译后会在函数名前面加上下划线前缀。

声明的话直接像下面这样就行了
C/C++ code
?
1
   int  __cdecl    implement( int  x); 
#ifndef _RBTREE_ITERATOR_H_ #define _RBTREE_ITERATOR_H_ #include &lt;iterator&gt; #include &lt;stack&gt; namespace RBTREE { template&lt;class KEY, class VALUE&gt; class RBTree; // 前向声明 template&lt;class KEY, class VALUE&gt; class RBTreeIterator { public: using iterator_category = std::forward_iterator_tag; using value_type = std::pair&lt;const KEY, VALUE&gt;; using difference_type = std::ptrdiff_t; using pointer = value_type*; using reference = value_type&amp;; // 构造函数 RBTreeIterator() : m_pCurrent(nullptr) {} // 从节点指针构造迭代器 explicit RBTreeIterator(RBTreeNode&lt;KEY, VALUE&gt;* node) : m_pCurrent(node) {} // 解引用操作符 reference operator*() const { return std::make_pair(m_pCurrent-&gt;m_Key, m_pCurrent-&gt;m_Value); } pointer operator-&gt;() const { return &amp;operator*(); } // 前缀递增操作符 RBTreeIterator&amp; operator++() { if (m_pCurrent-&gt;isNIL()) { m_pCurrent = nullptr; return *this; } // 如果右子树不为空,则找到右子树的最左节点 if (!m_pCurrent-&gt;m_pRight-&gt;isNIL()) { m_pCurrent = m_pCurrent-&gt;m_pRight; while (!m_pCurrent-&gt;m_pLeft-&gt;isNIL()) { m_pCurrent = m_pCurrent-&gt;m_pLeft; } } else { // 否则,向上找到第一个是左孩子的祖先 RBTreeNode&lt;KEY, VALUE&gt;* pParent = m_pCurrent-&gt;m_pParent; while (pParent != nullptr &amp;&amp; m_pCurrent == pParent-&gt;m_pRight) { m_pCurrent = pParent; pParent = pParent-&gt;m_pParent; } m_pCurrent = pParent; } return *this; } // 后缀递增操作符 RBTreeIterator operator++(int) { RBTreeIterator tmp = *this; ++(*this); return tmp; } // 比较操作符 bool operator==(const RBTreeIterator&amp; other) const { return m_pCurrent == other.m_pCurrent; } bool operator!=(const RBTreeIterator&amp; other) const { return !(*this == other); } private: RBTreeNode&lt;KEY, VALUE&gt;* m_pCurrent; // 友元声明,使RBTree可以访问私有成员 friend class RBTree&lt;KEY, VALUE&gt;; }; } #endif // _RBTREE_ITERATOR_H_ 这个才是我原始版本
07-24
请仔细阅读和分析下面函数,保持函数原始逻辑功能不变, 不要遗漏逻辑细节,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持原始函数定义不变,不要拆分函数 2.保持所有原始逻辑功能不变 3.结构体采用32位定义 4.严格保持protobuf字段映射关系,不要遗漏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 BelDefPip { optional uint32 pin1 = 1; optional uint32 pin2 = 2; repeated AttrSetting attrsettings = 3; } message AttrSetting { optional string attrname = 1; optional string attrvalue = 2; } 2.将函数中 _BYTE beldef_msg[16] 映射为 HDDMXng::BelDef beldef_msg void HDDMBelDef::HDDMBelDef(HDDMBelDef *this) { int beldef_code; // eax unsigned int v2; // eax LOWORD(this-&gt;beldef_code) &amp;= 0xC000u; LOBYTE(this-&gt;beldef_code1) &amp;= 0xF0u; LODWORD(this-&gt;char40) = 0; this-&gt;qword48 = 0LL; this-&gt;qword60 = 0LL; this-&gt;hddmPrimitive = 0LL; this-&gt;vtable = &amp;`vtable for&#39;HDDMBelDef + 2; beldef_code = this-&gt;beldef_code; this-&gt;qword30 = 0LL; this-&gt;pipsMatrixVec = 0LL; this-&gt;hddmBelPinDefArray = 0LL; this-&gt;hddmBelUsageDef = 0LL; beldef_code &amp;= 0xF0003FFF; this-&gt;beldef_code = beldef_code; HIBYTE(this-&gt;beldef_code) = HIBYTE(beldef_code) &amp; 0xCF; v2 = this-&gt;beldef_code1 &amp; 0xFFFC000F; this-&gt;beldef_code1 = v2; HIWORD(this-&gt;beldef_code1) = HIWORD(v2) | 0x3FFC; this-&gt;belDef_name = (std::string *)((char *)&amp;std::string::_Rep::_S_empty_rep_storage + 24); this-&gt;qword50 = &amp;this-&gt;char40; this-&gt;qword58 = &amp;this-&gt;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-&gt;hddmPrimitive; this-&gt;vtable = &amp;`vtable for&#39;HDDMBelDef + 2; if ( hddmPrimitive ) { vtable = (_QWORD *)hddmPrimitive-&gt;vtable; v4 = *(_QWORD **)&amp;hddmPrimitive-&gt;numPrimType; if ( (_QWORD *)hddmPrimitive-&gt;vtable == v4 ) { v5 = (void *)hddmPrimitive-&gt;vtable; } else { do { if ( *vtable ) { (*(void (__fastcall **)(_QWORD))(*(_QWORD *)*vtable + 24LL))(*vtable); hddmPrimitive = this-&gt;hddmPrimitive; v4 = *(_QWORD **)&amp;hddmPrimitive-&gt;numPrimType; } ++vtable; } while ( vtable != v4 ); v5 = (void *)hddmPrimitive-&gt;vtable; } if ( v5 ) operator delete(v5); operator delete(hddmPrimitive); this-&gt;hddmPrimitive = 0LL; } qword20 = (_QWORD *)this-&gt;pipsMatrixVec; if ( qword20 ) { v7 = (this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF; if ( !v7 ) goto LABEL_17; v8 = 0LL; do { v9 = (void *)qword20[v8]; if ( v9 ) { operator delete[](v9); *(_QWORD *)(this-&gt;pipsMatrixVec + 8 * v8) = 0LL; qword20 = (_QWORD *)this-&gt;pipsMatrixVec; v7 = (this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF; } ++v8; } while ( v7 &gt; (int)v8 ); if ( qword20 ) LABEL_17: operator delete[](qword20); this-&gt;pipsMatrixVec = 0LL; } if ( this-&gt;qword60 ) { for ( i = (HDDMBelDef *)this-&gt;qword50; i != (HDDMBelDef *)&amp;this-&gt;char40; i = (HDDMBelDef *)std::_Rb_tree_increment(i) ) { hddmBelPinDefArray = i-&gt;hddmBelPinDefArray; if ( hddmBelPinDefArray ) { pindef_name = (char *)hddmBelPinDefArray-&gt;pindef_name; v20 = *(char **)&amp;hddmBelPinDefArray-&gt;pindef_code; if ( pindef_name == *(char **)&amp;hddmBelPinDefArray-&gt;pindef_code ) { v25 = (void *)hddmBelPinDefArray-&gt;pindef_name; } else { v21 = *(char **)&amp;hddmBelPinDefArray-&gt;pindef_code; v22 = v20 + 8; if ( &amp;_pthread_key_create ) { do { v23 = *(_QWORD *)((char *)v22 + v21 - v20); if ( (_UNKNOWN *)(v23 - 24) != &amp;std::string::_Rep::_S_empty_rep_storage &amp;&amp; _InterlockedExchangeAdd((volatile signed __int32 *)(v23 - 8), 0xFFFFFFFF) &lt;= 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 != &amp;std::string::_Rep::_S_empty_rep_storage &amp;&amp; _InterlockedExchangeAdd((volatile signed __int32 *)(*(_QWORD *)v21 - 8LL), 0xFFFFFFFF) &lt;= 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) != &amp;std::string::_Rep::_S_empty_rep_storage ) { v29 = *(_DWORD *)(v26 - 8); *(_DWORD *)(v26 - 8) = v29 - 1; if ( v29 &lt;= 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 != &amp;std::string::_Rep::_S_empty_rep_storage ) { v30 = *(_DWORD *)(v27 - 8); *(_DWORD *)(v27 - 8) = v30 - 1; if ( v30 &lt;= 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 **)&amp;hddmBelPinDefArray-&gt;pindef_code; } if ( v25 ) operator delete(v25); operator delete(hddmBelPinDefArray); } } } v10 = this-&gt;hddmBelPinDefArray; if ( v10 ) { v11 = &amp;v10[v10[-1].pindef_name]; if ( v10 != v11 ) { v12 = v11 - 1; do { v13 = v12; v14 = v12--; HDDMBelPinDef::~HDDMBelPinDef(v13); v10 = this-&gt;hddmBelPinDefArray; } while ( v10 != v14 ); } operator delete[](&amp;v10[-1].pindef_name); this-&gt;hddmBelPinDefArray = 0LL; } qword30 = (_QWORD *)this-&gt;qword30; if ( qword30 ) { std::_Rb_tree&lt;std::string,std::pair&lt;std::string const,HDDMBelPinDef *&gt;,std::_Select1st&lt;std::pair&lt;std::string const,HDDMBelPinDef *&gt;&gt;,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;std::string const,HDDMBelPinDef *&gt;&gt;&gt;::_M_erase( this-&gt;qword30, qword30[2]); operator delete(qword30); this-&gt;qword30 = 0LL; } hddmBelUsageDef = this-&gt;hddmBelUsageDef; if ( hddmBelUsageDef ) { HDDMBelUsageDef::~HDDMBelUsageDef(this-&gt;hddmBelUsageDef); operator delete(hddmBelUsageDef); } this-&gt;hddmBelUsageDef = 0LL; sub_21726B0(this); std::_Rb_tree&lt;std::pair&lt;unsigned short,unsigned short&gt;,std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;,std::_Select1st&lt;std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;&gt;,std::less&lt;std::pair&lt;unsigned short,unsigned short&gt;&gt;,std::allocator&lt;std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;&gt;&gt;::_M_erase( &amp;this-&gt;field_38, this-&gt;qword48); std::string::_Rep::_M_dispose((char *)this-&gt;belDef_name - 24, v39); } void __fastcall HDDMBelDef::addpindefs(HDDMBelDef *this, __int16 index) { HDDMBelPinDef *hddmBelPinDefArray; // rbx unsigned __int16 v3; // r12 unsigned __int64 v4; // r14 __int64 v5; // r12 HDDMBelPinDef *v6; // rax HDDMBelPinDef *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 *p_pindef_name; // rsi HDDMBelPinDef *i; // rbp hddmBelPinDefArray = this-&gt;hddmBelPinDefArray; v3 = this-&gt;beldef_code &amp; 0x3FFF; HDDMBelDef::allocatepindefs(this, v3 + index); if ( v3 ) { v4 = 0LL; v5 = 16 * ((unsigned int)v3 - 1 + 1LL); do { v6 = &amp;this-&gt;hddmBelPinDefArray[v4 / 0x10]; v7 = &amp;hddmBelPinDefArray[v4 / 0x10]; v8 = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 1 | v6-&gt;pindef_code &amp; 0xFE; LOBYTE(v6-&gt;pindef_code) = v8; v9 = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 2 | v8 &amp; 0xFD; LOBYTE(v6-&gt;pindef_code) = v9; v10 = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 4 | v9 &amp; 0xFB; LOBYTE(v6-&gt;pindef_code) = v10; v11 = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 8 | v10 &amp; 0xF7; LOBYTE(v6-&gt;pindef_code) = v11; v12 = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 0x10 | v11 &amp; 0xEF; LOBYTE(v6-&gt;pindef_code) = v12; LOBYTE(v6-&gt;pindef_code) = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 0x20 | v12 &amp; 0xDF; v6-&gt;pindef_code = hddmBelPinDefArray[v4 / 0x10].pindef_code &amp; 0xFFFC0 | v6-&gt;pindef_code &amp; 0xFFF0003F; BYTE2(v6-&gt;pindef_code) = BYTE2(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 0xF0 | BYTE2(v6-&gt;pindef_code) &amp; 0xF; v13 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 1 | HIBYTE(v6-&gt;pindef_code) &amp; 0xFE; HIBYTE(v6-&gt;pindef_code) = v13; v14 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 2 | v13 &amp; 0xFD; HIBYTE(v6-&gt;pindef_code) = v14; v15 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 4 | v14 &amp; 0xFB; HIBYTE(v6-&gt;pindef_code) = v15; v16 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 8 | v15 &amp; 0xF7; HIBYTE(v6-&gt;pindef_code) = v16; v17 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 0x10 | v16 &amp; 0xEF; HIBYTE(v6-&gt;pindef_code) = v17; v18 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 0x20 | v17 &amp; 0xDF; HIBYTE(v6-&gt;pindef_code) = v18; v19 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 0x40 | v18 &amp; 0xBF; HIBYTE(v6-&gt;pindef_code) = v19; HIBYTE(v6-&gt;pindef_code) = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code) &amp; 0x80 | v19 &amp; 0x7F; LOBYTE(v6-&gt;pindef_code1) = hddmBelPinDefArray[v4 / 0x10].pindef_code1 &amp; 0xF | v6-&gt;pindef_code1 &amp; 0xF0; LOWORD(v6-&gt;pindef_code1) = hddmBelPinDefArray[v4 / 0x10].pindef_code1 &amp; 0xFFF0 | v6-&gt;pindef_code1 &amp; 0xF; HIWORD(v6-&gt;pindef_code1) = HIWORD(hddmBelPinDefArray[v4 / 0x10].pindef_code1) &amp; 0x3FF | HIWORD(v6-&gt;pindef_code1) &amp; 0xFC00; v20 = HIBYTE(hddmBelPinDefArray[v4 / 0x10].pindef_code1) &amp; 0x3C | HIBYTE(v6-&gt;pindef_code1) &amp; 0xC3; p_pindef_name = (const std::string *)&amp;hddmBelPinDefArray[v4 / 0x10].pindef_name; v4 += 16LL; HIBYTE(v6-&gt;pindef_code1) = v20; HIBYTE(v6-&gt;pindef_code1) = HIBYTE(v7-&gt;pindef_code1) &amp; 0xC0 | v20 &amp; 0x3F; std::string::assign((std::string *)&amp;v6-&gt;pindef_name, p_pindef_name); } while ( v4 != v5 ); } if ( hddmBelPinDefArray ) { for ( i = &amp;hddmBelPinDefArray[hddmBelPinDefArray[-1].pindef_name]; hddmBelPinDefArray != i; HDDMBelPinDef::~HDDMBelPinDef(i) ) { --i; } operator delete[](&amp;hddmBelPinDefArray[-1].pindef_name); } } __int64 __fastcall HDDMBelDef::addpipattrsetting( HDDMBelDef *this, unsigned __int16 a2, unsigned __int16 a3, const std::string *a4, const std::string *a5) { const std::string *v5; // r10 _QWORD *p_char40; // r14 __int64 qword48; // rax _QWORD *v10; // r9 _QWORD *v11; // rbp __int64 v12; // rax _QWORD *v13; // r8 _QWORD *v14; // rbx __int64 v15; // rax __int64 insert_hint_unique_pos; // rax __int64 v17; // rdx _QWORD *v18; // rbx __int64 v19; // rdi _QWORD *v20; // rax __int64 v21; // rax char *v22; // rdi __int64 result; // rax char *v24; // rdi unsigned __int16 v25; // ax int v26; // eax int v27; // edx unsigned int v28; // edx _WORD *v30; // [rsp+8h] [rbp-70h] char v33; // [rsp+2Fh] [rbp-49h] BYREF char *v34; // [rsp+30h] [rbp-48h] BYREF char *v35; // [rsp+38h] [rbp-40h] BYREF v5 = a4; p_char40 = &amp;this-&gt;char40; qword48 = this-&gt;qword48; if ( !qword48 ) goto LABEL_10; v10 = &amp;this-&gt;char40; do { while ( a2 &lt;= *(_WORD *)(qword48 + 32) &amp;&amp; (a2 &lt; *(_WORD *)(qword48 + 32) || a3 &lt;= *(_WORD *)(qword48 + 34)) ) { v10 = (_QWORD *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_8; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_8: if ( p_char40 == v10 || a2 &lt; *((_WORD *)v10 + 16) || a2 &lt;= *((_WORD *)v10 + 16) &amp;&amp; a3 &lt; *((_WORD *)v10 + 17) ) { LABEL_10: v11 = (_QWORD *)operator new(0x18uLL); *v11 = 0LL; v11[1] = 0LL; v11[2] = 0LL; v12 = this-&gt;qword48; v13 = &amp;this-&gt;char40; v5 = a4; if ( !v12 ) goto LABEL_16; do { if ( a2 &gt; *(_WORD *)(v12 + 32) || a2 &gt;= *(_WORD *)(v12 + 32) &amp;&amp; a3 &gt; *(_WORD *)(v12 + 34) ) { v12 = *(_QWORD *)(v12 + 24); } else { v13 = (_QWORD *)v12; v12 = *(_QWORD *)(v12 + 16); } } while ( v12 ); if ( p_char40 == v13 || a2 &lt; *((_WORD *)v13 + 16) || a2 &lt;= *((_WORD *)v13 + 16) &amp;&amp; a3 &lt; *((_WORD *)v13 + 17) ) { LABEL_16: v14 = v13; v15 = operator new(0x30uLL); if ( v15 ) { *(_DWORD *)v15 = 0; *(_QWORD *)(v15 + 8) = 0LL; *(_QWORD *)(v15 + 16) = 0LL; *(_QWORD *)(v15 + 24) = 0LL; *(_WORD *)(v15 + 32) = a2; *(_WORD *)(v15 + 34) = a3; *(_QWORD *)(v15 + 40) = 0LL; } v30 = (_WORD *)v15; insert_hint_unique_pos = std::_Rb_tree&lt;std::pair&lt;unsigned short,unsigned short&gt;,std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;,std::_Select1st&lt;std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;&gt;,std::less&lt;std::pair&lt;unsigned short,unsigned short&gt;&gt;,std::allocator&lt;std::pair&lt;std::pair&lt;unsigned short,unsigned short&gt; const,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt; *&gt;&gt;&gt;::_M_get_insert_hint_unique_pos( &amp;this-&gt;field_38, v14, v15 + 32); v18 = (_QWORD *)insert_hint_unique_pos; if ( v17 ) { v19 = 1LL; if ( !insert_hint_unique_pos &amp;&amp; p_char40 != (_QWORD *)v17 ) { v25 = *(_WORD *)(v17 + 32); if ( v30[16] &gt;= v25 &amp;&amp; (v30[16] &gt; v25 || v30[17] &gt;= *(_WORD *)(v17 + 34)) ) v19 = 0LL; } std::_Rb_tree_insert_and_rebalance(v19, v30, v17, p_char40); ++this-&gt;qword60; v13 = v30; v5 = a4; } else { operator delete(v30); v13 = v18; v5 = a4; } } v13[5] = v11; } else { v11 = (_QWORD *)v10[5]; } std::string::string((std::string *)&amp;v34, v5); std::string::string((std::string *)&amp;v35, a5); v20 = (_QWORD *)v11[1]; if ( v20 == (_QWORD *)v11[2] ) { std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt;::_M_emplace_back_aux&lt;std::pair&lt;std::string,std::string&gt;&gt;(v11, &amp;v34); } else { if ( v20 ) { *v20 = v34; v34 = (char *)&amp;std::string::_Rep::_S_empty_rep_storage + 24; v20[1] = v35; v35 = (char *)&amp;std::string::_Rep::_S_empty_rep_storage + 24; v21 = v11[1]; } else { v21 = 0LL; } v11[1] = v21 + 16; } v22 = v35 - 24; if ( v35 - 24 != (char *)&amp;std::string::_Rep::_S_empty_rep_storage ) { if ( &amp;_pthread_key_create ) { v26 = _InterlockedExchangeAdd((volatile signed __int32 *)v22 + 4, 0xFFFFFFFF); } else { v27 = *((_DWORD *)v35 - 2); *((_DWORD *)v35 - 2) = v27 - 1; v26 = v27; } if ( v26 &lt;= 0 ) std::string::_Rep::_M_destroy(v22, &amp;v33); } result = (__int64)v34; v24 = v34 - 24; if ( v34 - 24 != (char *)&amp;std::string::_Rep::_S_empty_rep_storage ) { if ( &amp;_pthread_key_create ) { result = (unsigned int)_InterlockedExchangeAdd((volatile signed __int32 *)v24 + 4, 0xFFFFFFFF); } else { v28 = *((_DWORD *)v34 - 2); *((_DWORD *)v34 - 2) = v28 - 1; result = v28; } if ( (int)result &lt;= 0 ) return std::string::_Rep::_M_destroy(v24, &amp;v33); } return result; } void __fastcall HDDMBelDef::addprimitive(HDDMBelDef *this, HDDMPrimitive *pHddmPrimitive) { HDDMPrimitive *hddmPrimitive; // rdi HDDMPrimitive **v4; // rdx __int64 v5; // rdx HDDMPrimitive *v6; // rax HDDMPrimitive *v7; // [rsp+8h] [rbp-10h] BYREF hddmPrimitive = this-&gt;hddmPrimitive; v7 = pHddmPrimitive; if ( !hddmPrimitive ) { v6 = (HDDMPrimitive *)operator new(0x18uLL); v6-&gt;vtable = 0LL; *(_QWORD *)&amp;v6-&gt;numPrimType = 0LL; hddmPrimitive = v6; v6-&gt;hddmBelDef = 0LL; this-&gt;hddmPrimitive = v6; } v4 = *(HDDMPrimitive ***)&amp;hddmPrimitive-&gt;numPrimType; if ( v4 == (HDDMPrimitive **)hddmPrimitive-&gt;hddmBelDef ) { std::vector&lt;HDDMPrimitive *&gt;::_M_emplace_back_aux&lt;HDDMPrimitive * const&amp;&gt;(hddmPrimitive, &amp;v7); } else { if ( v4 ) { *v4 = v7; v5 = *(_QWORD *)&amp;hddmPrimitive-&gt;numPrimType; } else { v5 = 0LL; } *(_QWORD *)&amp;hddmPrimitive-&gt;numPrimType = v5 + 8; } } __int64 __fastcall HDDMBelDef::allocatepindefs(HDDMBelDef *this, unsigned __int16 nIndex) { __int64 v2; // rbx _QWORD *v3; // rax HDDMBelPinDef *v4; // r14 HDDMBelPinDef *v5; // rbp unsigned int beldef_code_low; // eax __int64 result; // rax v2 = nIndex - 1LL; v3 = (_QWORD *)operator new[](16LL * nIndex + 8); v4 = (HDDMBelPinDef *)(v3 + 1); *v3 = nIndex; v5 = (HDDMBelPinDef *)(v3 + 1); if ( nIndex ) { do { HDDMBelPinDef::HDDMBelPinDef(v5); --v2; ++v5; } while ( v2 != -1 ); } beldef_code_low = LOWORD(this-&gt;beldef_code); this-&gt;hddmBelPinDefArray = v4; LOWORD(beldef_code_low) = beldef_code_low &amp; 0xC000; result = nIndex &amp; 0x3FFF | beldef_code_low; LOWORD(this-&gt;beldef_code) = result; return result; } void __fastcall HDDMBelDef::buildReservedBelTypes(HDDMBelDef *this, HDDMDevice *hddmDevice) { _QWORD *v2; // rax __int64 v3; // rax __int64 Site; // rbx int i; // ebp HDDMElement *Element; // rax __int64 BelDef; // rax _WORD *v8; // rax _QWORD *v9; // [rsp+8h] [rbp-90h] char v10; // [rsp+2Fh] [rbp-69h] BYREF HDDMSite v11; // [rsp+30h] [rbp-68h] BYREF _QWORD v12[9]; // [rsp+50h] [rbp-48h] BYREF v2 = (_QWORD *)operator new(0x18uLL); *v2 = 0LL; v2[1] = 0LL; v2[2] = 0LL; v9 = v2; v3 = (__int64)(this-&gt;field_80 - this-&gt;field_78) &gt;&gt; 3; if ( (_WORD)v3 ) std::vector&lt;unsigned char&gt;::_M_fill_insert(v9, 0LL, (unsigned __int16)v3, &amp;unk_7B5CA98); std::string::string(v12, &quot;CFG_IO_ACCESS&quot;, &amp;v11); sub_2165630(this, v9, v12, 2LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;USR_ACCESS&quot;, &amp;v11); sub_2165630(this, v9, v12, 3LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;EFUSE_USR&quot;, &amp;v11); sub_2165630(this, v9, v12, 3LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;DCIRESET&quot;, &amp;v11); sub_2165630(this, v9, v12, 3LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;ICAP_TOP&quot;, &amp;v11); sub_2165630(this, v9, v12, 4LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;ICAP_BOT&quot;, &amp;v11); sub_2165630(this, v9, v12, 4LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;STARTUP&quot;, &amp;v11); sub_2165630(this, v9, v12, 4LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;FRAME_ECC&quot;, &amp;v11); sub_2165630(this, v9, v12, 4LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); std::string::string(v12, &quot;PS8_X0Y0&quot;, &amp;v11); Site = HDDMDevice::getSite((HDDMDevice *)this, (const std::string *)v12); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v11.qword10); if ( Site ) { for ( i = 0; ; ++i ) { v8 = (_WORD *)(*(_QWORD *)(HDDMDeviceCache::m_devcache[(*(_BYTE *)(Site + 8) &gt;&gt; 2) &amp; 0xF] + 240LL) + 48LL * ((*(_DWORD *)Site &gt;&gt; 2) &amp; 0x3FFFFF)); if ( i &gt;= ((*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(HDDMDeviceCache::m_devcache[(*v8 &gt;&gt; 6) &amp; 0xF] + 168LL) + 8LL * (v8[2] &amp; 0x3FF)) + 120LL) + 8LL * *(unsigned __int8 *)(Site + 3)) + 12LL) &gt;&gt; 6) &amp; 0x1FFF) ) break; HDDMSite::getBel(&amp;v11, Site); if ( (unsigned __int8)HDDMBel::isBad((HDDMBel *)&amp;v11) ) { HDDMBel::~HDDMBel((HDDMBel *)&amp;v11); } else { Element = (HDDMElement *)HDDMBel::getElement((HDDMBel *)&amp;v11); BelDef = HDDMElement::getBelDef(Element); std::string::string((std::string *)&amp;v11.qword10, (const std::string *)(BelDef + 16)); if ( !strcmp((const char *)v11.qword10, &quot;PSS_ALTO_CORE&quot;) || !strcmp((const char *)v11.qword10, &quot;PSS_ALTO_CORE_PAD_CLK&quot;) ) { std::string::_Rep::_M_dispose(v11.qword10 - 24LL, v12); HDDMBel::~HDDMBel((HDDMBel *)&amp;v11); } else { std::string::string((std::string *)v12, (const std::string *)&amp;v11.qword10); sub_2165630(this, v9, v12, 1LL); std::string::_Rep::_M_dispose(v12[0] - 24LL, &amp;v10); std::string::_Rep::_M_dispose(v11.qword10 - 24LL, v12); HDDMBel::~HDDMBel((HDDMBel *)&amp;v11); } } } } } void __fastcall HDDMBelDef::createpindefsmap(HDDMBelDef *this) { __int64 v1; // rax HDDMBelPinDef *v2; // r12 _QWORD *v3; // r14 _QWORD *pindef_name; // rbx __int64 v5; // rbp size_t v6; // r13 int v7; // eax _QWORD *v8; // rdi size_t v9; // r15 size_t v10; // rdx _QWORD *v11; // rsi size_t v12; // rdx int v13; // eax unsigned __int16 v14; // [rsp+6h] [rbp-82h] __int64 v15; // [rsp+8h] [rbp-80h] size_t v16; // [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 v1 = operator new(0x30uLL); *(_DWORD *)(v1 + 8) = 0; *(_QWORD *)(v1 + 16) = 0LL; *(_QWORD *)(v1 + 40) = 0LL; qword30 = v1; *(_QWORD *)(v1 + 24) = v1 + 8; *(_QWORD *)(v1 + 32) = v1 + 8; this-&gt;qword30 = v1; v15 = v1 + 8; v14 = 0; if ( (this-&gt;beldef_code &amp; 0x3FFF) == 0 ) return; while ( 2 ) { v2 = &amp;this-&gt;hddmBelPinDefArray[v14]; v3 = *(_QWORD **)(qword30 + 16); if ( !v3 ) { v5 = v15; goto LABEL_24; } pindef_name = (_QWORD *)v2-&gt;pindef_name; v5 = v15; v6 = *(pindef_name - 3); do { while ( 1 ) { v8 = (_QWORD *)v3[4]; v9 = *(v8 - 3); v10 = v9; if ( v6 &lt;= v9 ) v10 = v6; v7 = memcmp(v8, pindef_name, v10); if ( !v7 ) break; LABEL_5: if ( v7 &lt; 0 ) goto LABEL_12; LABEL_6: v5 = (__int64)v3; v3 = (_QWORD *)v3[2]; if ( !v3 ) goto LABEL_13; } if ( (__int64)(v9 - v6) &gt; 0x7FFFFFFF ) goto LABEL_6; if ( (__int64)(v9 - v6) &gt;= (__int64)0xFFFFFFFF80000000LL ) { v7 = v9 - v6; goto LABEL_5; } LABEL_12: v3 = (_QWORD *)v3[3]; } while ( v3 ); LABEL_13: if ( v15 == v5 ) goto LABEL_24; v11 = *(_QWORD **)(v5 + 32); v12 = *(v11 - 3); v16 = v12; if ( v6 &lt;= v12 ) v12 = v6; v13 = memcmp(pindef_name, v11, v12); if ( v13 ) { LABEL_20: if ( v13 &lt; 0 ) goto LABEL_24; } else if ( (__int64)(v6 - v16) &lt;= 0x7FFFFFFF ) { if ( (__int64)(v6 - v16) &gt;= (__int64)0xFFFFFFFF80000000LL ) { v13 = v6 - v16; goto LABEL_20; } LABEL_24: p_pindef_name = &amp;v2-&gt;pindef_name; v5 = std::_Rb_tree&lt;std::string,std::pair&lt;std::string const,HDDMBelPinDef *&gt;,std::_Select1st&lt;std::pair&lt;std::string const,HDDMBelPinDef *&gt;&gt;,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;std::string const,HDDMBelPinDef *&gt;&gt;&gt;::_M_emplace_hint_unique&lt;std::piecewise_construct_t const&amp;,std::tuple&lt;std::string const&amp;&gt;,std::tuple&lt;&gt;&gt;( qword30, v5, &amp;unk_7B5CA99, &amp;p_pindef_name, &amp;v19); } *(_QWORD *)(v5 + 40) = v2; if ( ++v14 &lt; (this-&gt;beldef_code &amp; 0x3FFF) ) { qword30 = this-&gt;qword30; v15 = qword30 + 8; continue; } break; } } 请 __int64 ushortVec 映射为 std::vector &lt;uint16_t&gt; ushortVec void __fastcall HDDMBelDef::getDrivenPins(HDDMBelDef *this, __int64 ushortVec, unsigned __int16 nIndex) { __int64 qword20; // rax int v6; // esi unsigned __int16 v7; // di int v8; // r13d __int64 v9; // rbx __int64 v10; // r14 _WORD *v11; // rcx __int16 v12; // ax bool v13; // zf __int64 v14; // rax _WORD v15[36]; // [rsp+0h] [rbp-48h] BYREF qword20 = this-&gt;pipsMatrixVec; if ( qword20 ) { v6 = this-&gt;beldef_code &gt;&gt; 14; v7 = (this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF; v8 = (unsigned __int16)((this-&gt;beldef_code &amp; 0x3FFF) - ((v6 &amp; 0x3FFF) + v7)) + v7; if ( v8 ) { v9 = 0LL; v10 = 8LL * nIndex; while ( 1 ) { if ( !*(_BYTE *)(*(_QWORD *)(qword20 + v10) + v9) ) goto LABEL_4; v11 = *(_WORD **)(ushortVec + 8); v12 = v9 + ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF); v13 = v11 == *(_WORD **)(ushortVec + 16); v15[0] = v12; if ( v13 ) break; if ( v11 ) { *v11 = v12; v14 = *(_QWORD *)(ushortVec + 8); } else { v14 = 0LL; } ++v9; *(_QWORD *)(ushortVec + 8) = v14 + 2; if ( v8 &lt;= (int)v9 ) return; LABEL_5: qword20 = this-&gt;pipsMatrixVec; } std::vector&lt;unsigned short&gt;::_M_emplace_back_aux&lt;unsigned short&gt;(ushortVec, v15); LABEL_4: if ( v8 &lt;= (int)++v9 ) return; goto LABEL_5; } } } void __fastcall HDDMBelDef::getDrivingPins(HDDMBelDef *this, __int64 ushortVec, unsigned __int16 nIndex) { __int64 qword20; // rax unsigned __int16 v4; // r8 int v5; // r14d int v6; // r13d __int64 v7; // rbx _WORD *v8; // rax bool v9; // zf __int64 v10; // rax _WORD v11[36]; // [rsp+0h] [rbp-48h] BYREF qword20 = this-&gt;pipsMatrixVec; if ( qword20 ) { v4 = (this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF; v5 = nIndex - ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF); v6 = v4 + (unsigned __int16)((this-&gt;beldef_code &amp; 0x3FFF) - (((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF) + v4)); if ( v6 ) { v7 = 0LL; while ( 1 ) { if ( !*(_BYTE *)(*(_QWORD *)(qword20 + 8 * v7) + v5) ) goto LABEL_4; v8 = *(_WORD **)(ushortVec + 8); v9 = v8 == *(_WORD **)(ushortVec + 16); v11[0] = v7; if ( v9 ) break; if ( v8 ) { *v8 = v7; v10 = *(_QWORD *)(ushortVec + 8); } else { v10 = 0LL; } ++v7; *(_QWORD *)(ushortVec + 8) = v10 + 2; if ( v6 &lt;= (int)v7 ) return; LABEL_5: qword20 = this-&gt;pipsMatrixVec; } std::vector&lt;unsigned short&gt;::_M_emplace_back_aux&lt;unsigned short&gt;(ushortVec, v11); LABEL_4: if ( v6 &lt;= (int)++v7 ) return; goto LABEL_5; } } } void __fastcall HDDMBelDef::getNextDrivenPin(HDDMBelDef *this, unsigned __int16 a2, int index) { __int64 qword20; // r8 unsigned __int16 v4; // cx __int16 v5; // r9 unsigned __int16 v6; // di __int16 v7; // dx __int64 v8; // rdx qword20 = this-&gt;pipsMatrixVec; if ( qword20 ) { v4 = 0; v5 = (this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF; v6 = (this-&gt;beldef_code &amp; 0x3FFF) - v5; v7 = index - v5 + 1; if ( v7 &gt;= 0 ) v4 = v7; if ( v6 &gt; v4 ) { v8 = *(_QWORD *)(qword20 + 8LL * a2); if ( !*(_BYTE *)(v8 + v4) ) { do ++v4; while ( v6 &gt; v4 &amp;&amp; !*(_BYTE *)(v8 + v4) ); } } } } void __fastcall HDDMBelDef::getNextDrivingPin(HDDMBelDef *this, __int16 a2, unsigned int index) { __int64 qword20; // r9 unsigned __int16 v4; // si unsigned __int16 v5; // r8 unsigned __int16 v6; // cx __int16 v7; // dx qword20 = this-&gt;pipsMatrixVec; if ( qword20 ) { v4 = a2 - ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF); v5 = (this-&gt;beldef_code &amp; 0x3FFF) - ((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF); v6 = 0; v7 = index + 1; if ( v7 &gt;= 0 ) v6 = v7; for ( ; v5 &gt; v6 &amp;&amp; !*(_BYTE *)(*(_QWORD *)(qword20 + 8LL * v6) + v4); ++v6 ) ; } } __int64 __fastcall HDDMBelDef::getNumArcs(HDDMBelDef *this, unsigned __int16 a2) { int v2; // eax int NumFwdArcs; // r12d v2 = *(_BYTE *)(HDDMBelDef::getPinDef(this, a2) + 7) &amp; 0xC0; if ( !v2 ) return HDDMBelDef::getNumFwdArcs(this, a2); if ( (_BYTE)v2 == 0x80 ) return HDDMBelDef::getNumReverseArcs(this, a2); NumFwdArcs = HDDMBelDef::getNumFwdArcs(this, a2); return NumFwdArcs + (unsigned int)HDDMBelDef::getNumReverseArcs(this, a2); } __int64 __fastcall HDDMBelDef::getNumFwdArcs(HDDMBelDef *this, unsigned __int16 a2) { __int64 qword20; // rcx unsigned __int16 v3; // r9 int v4; // eax int v5; // edi __int64 v6; // rdx __int64 result; // rax __int64 v8; // rsi qword20 = this-&gt;pipsMatrixVec; if ( !qword20 ) return 0LL; v3 = (this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF; v4 = (unsigned __int16)((this-&gt;beldef_code &amp; 0x3FFF) - (((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF) + v3)); v5 = v4 + ((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF); if ( !(v4 + v3) ) return 0LL; v6 = 0LL; result = 0LL; v8 = *(_QWORD *)(qword20 + 8LL * a2); do { if ( *(_BYTE *)(v8 + v6) ) result = (unsigned int)(result + 1); ++v6; } while ( v5 &gt; (int)v6 ); return result; } __int64 __fastcall HDDMBelDef::getNumPips(HDDMBelDef *this) { __int64 qword20; // r9 int v2; // eax int v3; // r10d int v4; // esi __int64 v5; // r8 __int64 result; // rax __int64 v7; // rdx qword20 = this-&gt;pipsMatrixVec; if ( !qword20 ) return 0LL; v2 = (unsigned __int16)((this-&gt;beldef_code &amp; 0x3FFF) - (((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF) + ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF))); v3 = v2 + ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF); v4 = v2 + ((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF); if ( !v3 ) return 0LL; v5 = 0LL; result = 0LL; do { if ( v4 ) { v7 = 0LL; do { if ( *(_BYTE *)(*(_QWORD *)(qword20 + 8 * v5) + v7) ) result = (unsigned int)(result + 1); ++v7; } while ( v4 &gt; (int)v7 ); } ++v5; } while ( v3 &gt; (int)v5 ); return result; } __int64 __fastcall HDDMBelDef::getNumReverseArcs(HDDMBelDef *this, __int16 a2) { __int64 qword20; // r8 unsigned __int16 v3; // dx unsigned __int16 v4; // si int v5; // r9d __int64 v6; // rdx __int64 result; // rax qword20 = this-&gt;pipsMatrixVec; if ( !qword20 ) return 0LL; v3 = (this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF; v4 = a2 - v3; v5 = (unsigned __int16)((this-&gt;beldef_code &amp; 0x3FFF) - (((this-&gt;beldef_code1 &gt;&gt; 4) &amp; 0x3FFF) + v3)) + v3; if ( !v5 ) return 0LL; v6 = 0LL; result = 0LL; do { if ( *(_BYTE *)(*(_QWORD *)(qword20 + 8 * v6) + v4) ) result = (unsigned int)(result + 1); ++v6; } while ( v5 &gt; (int)v6 ); return result; } __int64 __fastcall HDDMBelDef::getPinByName(HDDMBelDef *this, const void **a2) { __int64 qword30; // rax _QWORD *v3; // rbx _QWORD *v4; // r14 const void *v5; // r12 _QWORD *v6; // r13 size_t v7; // r15 int v8; // eax _QWORD *v9; // rdi size_t v10; // rdx size_t v11; // rbp __int64 v12; // rbp _QWORD *v13; // rsi size_t v14; // rdx size_t v15; // rbx int v16; // eax __int64 v17; // r15 __int64 result; // rax qword30 = this-&gt;qword30; v3 = *(_QWORD **)(qword30 + 16); v4 = (_QWORD *)(qword30 + 8); if ( !v3 ) return 0LL; v5 = *a2; v6 = (_QWORD *)(qword30 + 8); v7 = *((_QWORD *)*a2 - 3); do { while ( 1 ) { v9 = (_QWORD *)v3[4]; v10 = v7; v11 = *(v9 - 3); if ( v11 &lt;= v7 ) v10 = *(v9 - 3); v8 = memcmp(v9, v5, v10); if ( !v8 ) break; LABEL_4: if ( v8 &lt; 0 ) goto LABEL_11; LABEL_5: v6 = v3; v3 = (_QWORD *)v3[2]; if ( !v3 ) goto LABEL_12; } v12 = v11 - v7; if ( v12 &gt; 0x7FFFFFFF ) goto LABEL_5; if ( v12 &gt;= (__int64)0xFFFFFFFF80000000LL ) { v8 = v12; goto LABEL_4; } LABEL_11: v3 = (_QWORD *)v3[3]; } while ( v3 ); LABEL_12: if ( v4 == v6 ) return 0LL; v13 = (_QWORD *)v6[4]; v14 = v7; v15 = *(v13 - 3); if ( v15 &lt;= v7 ) v14 = *(v13 - 3); v16 = memcmp(v5, v13, v14); if ( v16 ) { LABEL_21: if ( v16 &gt;= 0 ) return v6[5]; return 0LL; } v17 = v7 - v15; if ( v17 &gt; 0x7FFFFFFF ) return v6[5]; result = 0LL; if ( v17 &gt;= (__int64)0xFFFFFFFF80000000LL ) { v16 = v17; goto LABEL_21; } return result; } __int64 __fastcall HDDMBelDef::getRouteThruSettings(HDDMBelDef *this, unsigned int a2, int a3, __int64 **a4) { __int64 result; // rax int v6; // r8d unsigned __int16 v7; // r14 __int64 *v8; // rbp __int64 *v9; // r12 __int64 *v10; // r9 _BYTE *v11; // r11 __int64 v12; // rsi void *v13; // rdi __int64 qword20; // r9 __int64 qword48; // rsi _QWORD *p_char40; // rdi __int64 *v17; // r14 __int64 v18; // rax __int64 v19; // rax void *v20; // rdi int v21; // edx int v22; // edx _BYTE *v23; // [rsp+8h] [rbp-70h] _BYTE *v24; // [rsp+8h] [rbp-70h] __int64 *v25; // [rsp+10h] [rbp-68h] __int64 *v26; // [rsp+10h] [rbp-68h] unsigned int v27; // [rsp+1Ch] [rbp-5Ch] unsigned int v28; // [rsp+1Ch] [rbp-5Ch] int v29; // [rsp+20h] [rbp-58h] int v30; // [rsp+20h] [rbp-58h] __int16 v31; // [rsp+20h] [rbp-58h] int v32; // [rsp+24h] [rbp-54h] int v33; // [rsp+24h] [rbp-54h] __int16 v34; // [rsp+24h] [rbp-54h] __int64 **v35; // [rsp+28h] [rbp-50h] __int64 **v36; // [rsp+28h] [rbp-50h] __int64 **v37; // [rsp+28h] [rbp-50h] _BYTE v38[57]; // [rsp+3Fh] [rbp-39h] BYREF result = a2; v6 = a3; v7 = a2; v8 = *a4; v9 = a4[1]; if ( *a4 != v9 ) { v10 = *a4; if ( &amp;_pthread_key_create ) { v11 = v38; do { v12 = v10[1]; if ( (_UNKNOWN *)(v12 - 24) != &amp;std::string::_Rep::_S_empty_rep_storage &amp;&amp; _InterlockedExchangeAdd((volatile signed __int32 *)(v12 - 8), 0xFFFFFFFF) &lt;= 0 ) { v35 = a4; v32 = a3; v29 = v6; v27 = result; v25 = v10; v23 = v11; std::string::_Rep::_M_destroy(v12 - 24, v11); a4 = v35; a3 = v32; v6 = v29; result = v27; v10 = v25; v11 = v23; } v13 = (void *)(*v10 - 24); if ( v13 != &amp;std::string::_Rep::_S_empty_rep_storage &amp;&amp; _InterlockedExchangeAdd((volatile signed __int32 *)(*v10 - 8), 0xFFFFFFFF) &lt;= 0 ) { v36 = a4; v33 = a3; v30 = v6; v28 = result; v26 = v10; v24 = v11; std::string::_Rep::_M_destroy(v13, v11); a4 = v36; a3 = v33; v6 = v30; result = v28; v10 = v26; v11 = v24; } v10 += 2; } while ( v9 != v10 ); } else { v17 = *a4; v31 = a3; v34 = a3; v37 = a4; do { v18 = v17[1]; if ( (_UNKNOWN *)(v18 - 24) != &amp;std::string::_Rep::_S_empty_rep_storage ) { v21 = *(_DWORD *)(v18 - 8); *(_DWORD *)(v18 - 8) = v21 - 1; if ( v21 &lt;= 0 ) std::string::_Rep::_M_destroy(v18 - 24, v38); } v19 = *v17; v20 = (void *)(*v17 - 24); if ( v20 != &amp;std::string::_Rep::_S_empty_rep_storage ) { v22 = *(_DWORD *)(v19 - 8); *(_DWORD *)(v19 - 8) = v22 - 1; if ( v22 &lt;= 0 ) std::string::_Rep::_M_destroy(v20, v38); } v17 += 2; } while ( v9 != v17 ); v7 = a2; result = a2; LOWORD(v6) = v31; LOWORD(a3) = v34; a4 = v37; } } a4[1] = v8; qword20 = this-&gt;pipsMatrixVec; if ( qword20 ) { if ( *(_BYTE *)(*(_QWORD *)(qword20 + 8LL * v7) + (unsigned __int16)a3 - ((this-&gt;beldef_code &gt;&gt; 14) &amp; 0x3FFF)) ) { qword48 = this-&gt;qword48; if ( qword48 ) { p_char40 = &amp;this-&gt;char40; do { while ( v7 &lt;= *(_WORD *)(qword48 + 32) &amp;&amp; (v7 &lt; *(_WORD *)(qword48 + 32) || (unsigned __int16)v6 &lt;= *(_WORD *)(qword48 + 34)) ) { p_char40 = (_QWORD *)qword48; qword48 = *(_QWORD *)(qword48 + 16); if ( !qword48 ) goto LABEL_17; } qword48 = *(_QWORD *)(qword48 + 24); } while ( qword48 ); LABEL_17: if ( &amp;this-&gt;char40 != p_char40 &amp;&amp; (unsigned __int16)result &gt;= *((_WORD *)p_char40 + 16) &amp;&amp; ((unsigned __int16)result &gt; *((_WORD *)p_char40 + 16) || (unsigned __int16)a3 &gt;= *((_WORD *)p_char40 + 17)) ) { return std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt;::_M_assign_aux&lt;__gnu_cxx::__normal_iterator&lt;std::pair&lt;std::string,std::string&gt;*,std::vector&lt;std::pair&lt;std::string,std::string&gt;&gt;&gt;&gt;( a4, *(_QWORD *)p_char40[5], *(_QWORD *)(p_char40[5] + 8LL)); } } } } 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 = 0LL; v3 = a2 &amp; 0xF; v4 = 0; result = v3 | this-&gt;beldef_code1 &amp; 0xF0u; v6 = 16 * v3; v7 = (this-&gt;beldef_code &amp; 0x3FFF) == 0; LOBYTE(this-&gt;beldef_code1) = result; if ( !v7 ) { do { ++v4; BYTE2(this-&gt;hddmBelPinDefArray[v2].pindef_code) = v6 | BYTE2(this-&gt;hddmBelPinDefArray[v2].pindef_code) &amp; 0xF; ++v2; result = this-&gt;beldef_code &amp; 0x3FFF; } while ( (int)result &gt; v4 ); } hddmBelUsageDef = this-&gt;hddmBelUsageDef; if ( hddmBelUsageDef ) return HDDMBelUsageDef::setrecursivedeviceid(hddmBelUsageDef, a2); return result; }
最新发布
10-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值