请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码
特别注意:
1.保持所有原始功能不变
2.提高执行效率,降低计算复杂度
3.已经给定的结构体名字和元素不要更改,详细的中文注释
4.自动添加中文注释说明功能逻辑
5.不使用 auto,使用显式 for 循环
6.结构体采用32位定义
7.不要使用小函数,保持原始的函数定义
8.严格保持protobuf字段映射关系
函数中的 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;
}
将 _BYTE arch_msg[8] 映射为 HDDMXng::Architecture arch_msg;
void __cdecl HDDMDevice::readarch_pb(HDDMDevice *this, const HSTString *archFilePath, unsigned __int16 nFileVersion)
{
int v3; // ebp
int v4; // edi
int v5; // esi
int v6; // eax
int j; // ebp
int v8; // eax
HDDMDevice *v9; // eax
int *dword68; // esi
int *v11; // ebp
HDDMDevice *v12; // eax
char *dword74; // esi
void *v14; // edi
int dword198; // ebp
signed int v16; // edi
HDDMSiteType *v17; // edi
char *dword80; // esi
int dword1B0; // esi
int v20; // ebp
void *v21; // edi
signed int v22; // edi
HDDMTileType *v23; // edi
char *dword8C; // esi
int dword180; // esi
int v26; // ebp
void *v27; // edi
char *dword70; // ecx
int v29; // eax
unsigned int v30; // edx
unsigned int v31; // eax
char *v32; // edi
int **v33; // edx
int **v34; // eax
_DWORD *v35; // esi
HDDMDevice *v36; // eax
void *ptr; // ecx
char *src; // ecx
size_t n; // ebp
int v40; // eax
unsigned int v41; // edx
unsigned int v42; // eax
char *v43; // edi
HDDMTileType **v44; // edx
HDDMTileType **v45; // eax
_DWORD *v46; // esi
HDDMDevice *v47; // eax
void *dword7C; // ecx
char *dword88; // ecx
size_t v50; // ebp
int v51; // eax
unsigned int v52; // edx
unsigned int v53; // eax
char *v54; // edi
HDDMTileType **v55; // edx
HDDMTileType **v56; // eax
_DWORD *v57; // esi
HDDMDevice *v58; // eax
void *v59; // ecx
int v60; // edi
int v61; // edi
size_t v62; // esi
int v63; // edi
int i; // esi
char *v65; // [esp+4h] [ebp-258h]
char *srca; // [esp+4h] [ebp-258h]
char *srcb; // [esp+4h] [ebp-258h]
size_t v68; // [esp+8h] [ebp-254h]
size_t v69; // [esp+18h] [ebp-244h]
size_t v70; // [esp+18h] [ebp-244h]
char *v71; // [esp+18h] [ebp-244h]
char *v72; // [esp+18h] [ebp-244h]
char *v73; // [esp+18h] [ebp-244h]
size_t v74; // [esp+18h] [ebp-244h]
size_t v75; // [esp+18h] [ebp-244h]
size_t v76; // [esp+18h] [ebp-244h]
size_t v77; // [esp+18h] [ebp-244h]
size_t v78; // [esp+18h] [ebp-244h]
size_t v79; // [esp+18h] [ebp-244h]
size_t v80; // [esp+18h] [ebp-244h]
HDDMTileType *p_dword64; // [esp+1Ch] [ebp-240h]
HDDMTileType *k; // [esp+1Ch] [ebp-240h]
HDDMTileType *v83; // [esp+1Ch] [ebp-240h]
HDDMTileType *v84; // [esp+1Ch] [ebp-240h]
int m; // [esp+24h] [ebp-238h]
int *v86; // [esp+28h] [ebp-234h]
int v87; // [esp+2Ch] [ebp-230h]
int ii; // [esp+2Ch] [ebp-230h]
signed int v89; // [esp+30h] [ebp-22Ch]
unsigned int v90; // [esp+30h] [ebp-22Ch]
unsigned int v91; // [esp+30h] [ebp-22Ch]
char v92[16]; // [esp+40h] [ebp-21Ch] BYREF
char *v93; // [esp+50h] [ebp-20Ch]
char *v94; // [esp+60h] [ebp-1FCh]
char *v95; // [esp+70h] [ebp-1ECh]
char *v96; // [esp+7Ch] [ebp-1E0h] BYREF
char *v97; // [esp+80h] [ebp-1DCh] BYREF
char *v98; // [esp+84h] [ebp-1D8h] BYREF
_BYTE v99[16]; // [esp+90h] [ebp-1CCh] BYREF
int v100; // [esp+A0h] [ebp-1BCh]
void *v101; // [esp+A4h] [ebp-1B8h]
_BYTE v102[16]; // [esp+B0h] [ebp-1ACh] BYREF
int v103; // [esp+C0h] [ebp-19Ch]
void *v104; // [esp+C4h] [ebp-198h]
_BYTE v105[24]; // [esp+C8h] [ebp-194h] BYREF
_BYTE v106[24]; // [esp+E0h] [ebp-17Ch] BYREF
int v107; // [esp+F8h] [ebp-164h]
_BYTE v108[24]; // [esp+100h] [ebp-15Ch] BYREF
int v109; // [esp+118h] [ebp-144h]
int v110[10]; // [esp+120h] [ebp-13Ch] BYREF
_BYTE v111[8]; // [esp+148h] [ebp-114h] BYREF
int v112[24]; // [esp+150h] [ebp-10Ch] BYREF
_BYTE arch_msg[8]; // [esp+1B0h] [ebp-ACh] BYREF
int v114; // [esp+1B8h] [ebp-A4h]
int v115; // [esp+1BCh] [ebp-A0h]
int v116; // [esp+1C0h] [ebp-9Ch]
int v117; // [esp+1DCh] [ebp-80h]
size_t v118; // [esp+1E0h] [ebp-7Ch]
int v119; // [esp+1FCh] [ebp-60h]
size_t v120; // [esp+200h] [ebp-5Ch]
int v121; // [esp+21Ch] [ebp-40h]
unsigned int v122; // [esp+220h] [ebp-3Ch]
unsigned int v123; // [esp+224h] [ebp-38h]
unsigned int v124; // [esp+228h] [ebp-34h]
isl::iostreams::filtering_stream<boost::iostreams::input,char,stlp_std::char_traits<char>,stlp_std::allocator<char>,boost::iostreams::public_>::filtering_stream(
v111,
*((_DWORD *)archFilePath + 5),
4,
0);
this->byte1E0 = nFileVersion > 1u;
this->nArchFileVersion = nFileVersion;
sub_8D8DC4();
HDDMXng::Architecture::Architecture((HDDMXng::Architecture *)arch_msg);
HDDMDevice::readMessage((int)v112, (google::protobuf::MessageLite *)arch_msg);
this->word20 = v121;
if ( (char *)v114 != &this->deviceFilePath )
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_assign(
(int)&this->deviceFilePath,
*(void **)(v114 + 20),
*(_DWORD *)(v114 + 16));
HDDMDevice::setupArchSpecific(this);
v3 = v116;
if ( v116 )
{
this->byte148 = 1;
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::reserve(
&this->char13C,
v3);
if ( v3 > 0 )
{
for ( i = 0; i != v3; ++i )
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::push_back(
&this->char13C,
*(_DWORD *)(v115 + 4 * i));
}
}
v69 = v118;
if ( v118 )
{
v4 = v118;
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::reserve(
&this->char58,
v118);
if ( v4 > 0 )
{
v5 = 0;
do
{
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::push_back(
&this->char58,
*(_DWORD *)(v117 + 4 * v5));
*(_WORD *)stlp_std::map<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,unsigned short,stlp_std::less<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>,stlp_std::allocator<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,unsigned short>>>::operator[]<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>(
&this->char1C4,
*(_DWORD *)(v117 + 4 * v5)) = v5;
++v5;
}
while ( v5 != v69 );
}
}
v70 = v120;
p_dword64 = (HDDMTileType *)&this->dword64;
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::reserve(
&this->dword64,
v120);
if ( v70 )
{
v6 = 0;
for ( j = 0; j != v70; v6 = j )
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(
v110,
*(_DWORD *)(v119 + 4 * v6));
dword68 = (int *)this->dword68;
if ( dword68 == (int *)this->dword6C )
{
if ( this->dword64 > (unsigned int)v110 || dword68 <= v110 )
{
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::_M_insert_overflow_aux(
p_dword64,
dword68,
v110,
v92,
1,
1);
v9 = this;
}
else
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(
v105,
(int)v110);
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::_M_insert_overflow_aux(
p_dword64,
dword68,
v105,
v108,
1,
1);
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v105);
v9 = this;
}
}
else
{
if ( dword68 )
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(
dword68,
(int)v110);
v8 = this->dword68;
}
else
{
v8 = 0;
}
this->dword68 = v8 + 24;
v9 = this;
}
*(_WORD *)stlp_std::map<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,unsigned short,stlp_std::less<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>,stlp_std::allocator<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,unsigned short>>>::operator[]<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>(
&v9->char164,
v110) = j;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v110);
++j;
}
}
v89 = v122;
stlp_std::vector<HDDMBelDef *,stlp_std::allocator<HDDMBelDef *>>::reserve(&this->dword70, v122);
if ( v89 > 0 )
{
for ( k = 0; (HDDMTileType *)v89 != k; k = (HDDMTileType *)((char *)k + 1) )
{
if ( (unsigned __int16)this->word20 <= (int)k )
{
v11 = (int *)operator new(0x54u);
HDDMBelDef::HDDMBelDef((HDDMBelDef *)v11);
*v11 = (int)(&`vtable for'HDDMRbelDef + 2);
*((_BYTE *)v11 + 8) |= 2u;
v12 = this;
dword74 = (char *)this->dword74;
if ( dword74 != (char *)this->dword78 )
{
LABEL_24:
*(_DWORD *)dword74 = v11;
v12->dword74 += 4;
goto LABEL_25;
}
}
else
{
v11 = (int *)operator new(0x54u);
HDDMBelDef::HDDMBelDef((HDDMBelDef *)v11);
*v11 = (int)(&`vtable for'HDDMLbelDef + 2);
v12 = this;
dword74 = (char *)this->dword74;
if ( dword74 != (char *)this->dword78 )
goto LABEL_24;
}
dword70 = (char *)v12->dword70;
v74 = dword74 - dword70;
v29 = 1;
v30 = (dword74 - dword70) >> 2;
if ( v30 )
v29 = (dword74 - dword70) >> 2;
v31 = v30 + v29;
if ( v31 > 0x3FFFFFFF || v30 > v31 )
{
v61 = -4;
}
else
{
if ( !v31 )
{
v32 = 0;
v33 = 0;
v34 = 0;
if ( v74 )
goto LABEL_97;
goto LABEL_65;
}
v61 = 4 * v31;
}
v34 = (int **)stlp_std::__malloc_alloc::allocate((stlp_std::__malloc_alloc *)v61, (unsigned int)v65);
v33 = v34;
dword70 = (char *)this->dword70;
v74 = dword74 - dword70;
v32 = (char *)v34 + (v61 & 0xFFFFFFFC);
if ( dword74 != dword70 )
{
LABEL_97:
v62 = v74;
v68 = v74;
v79 = (size_t)v33;
v34 = (int **)((char *)memmove(v33, dword70, v68) + v62);
v33 = (int **)v79;
}
LABEL_65:
*v34 = v11;
v35 = v34 + 1;
v36 = this;
ptr = (void *)this->dword70;
if ( ptr )
{
v75 = (size_t)v33;
free(ptr);
v33 = (int **)v75;
v36 = this;
}
v36->dword70 = v33;
v36->dword74 = v35;
v36->dword78 = v32;
LABEL_25:
*((_WORD *)v11 + 5) = (16 * (_WORD)k) | *((_WORD *)v11 + 5) & 0xF;
(*(void (__cdecl **)(int *, int *, HDDMDevice *, _DWORD))(*v11 + 16))(v11, v112, this, nFileVersion);
if ( this->dword198 )
{
v87 = v11[7];
v14 = (void *)v11[8];
v71 = &this->char194;
v86 = v11;
dword198 = this->dword198;
do
{
while ( stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
*(void **)(dword198 + 36),
*(_DWORD *)(dword198 + 32),
v14,
v87) >= 0 )
{
v71 = (char *)dword198;
dword198 = *(_DWORD *)(dword198 + 8);
if ( !dword198 )
goto LABEL_30;
}
dword198 = *(_DWORD *)(dword198 + 12);
}
while ( dword198 );
LABEL_30:
v11 = v86;
if ( &this->char194 != v71
&& stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
v14,
v87,
*((void **)v71 + 9),
*((_DWORD *)v71 + 8)) >= 0 )
{
goto LABEL_32;
}
}
else
{
v71 = &this->char194;
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(
v106,
(int)(v11 + 3));
v107 = 0;
v93 = v71;
v65 = &this->char194;
stlp_std::priv::_Rb_tree<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::less<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>,stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMBelDef *>,stlp_std::priv::_Select1st<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMBelDef *>>,stlp_std::priv::_MapTraitsT<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMBelDef *>>,stlp_std::allocator<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMBelDef *>>>::insert_unique(&v96);
v71 = v96;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v106);
LABEL_32:
*((_DWORD *)v71 + 10) = v11;
}
}
v16 = v123;
v90 = v123;
stlp_std::vector<HDDMSiteType *,stlp_std::allocator<HDDMSiteType *>>::reserve(&this->dword7C, v123);
if ( v16 > 0 )
{
for ( m = 0; v90 != m; ++m )
{
v17 = (HDDMSiteType *)operator new(0xE4u);
v83 = v17;
HDDMSiteType::HDDMSiteType(v17);
dword80 = (char *)this->dword80;
if ( dword80 != (char *)this->dword84 )
{
*(_DWORD *)dword80 = v17;
this->dword80 += 4;
goto LABEL_37;
}
src = (char *)this->dword7C;
n = dword80 - src;
v40 = 1;
v41 = (dword80 - src) >> 2;
if ( v41 )
v40 = (dword80 - src) >> 2;
v42 = v41 + v40;
if ( v42 > 0x3FFFFFFF || v41 > v42 )
{
v60 = -4;
}
else
{
if ( !v42 )
{
v43 = 0;
v44 = 0;
v45 = 0;
if ( n )
goto LABEL_94;
goto LABEL_80;
}
v60 = 4 * v42;
}
v45 = (HDDMTileType **)stlp_std::__malloc_alloc::allocate((stlp_std::__malloc_alloc *)v60, (unsigned int)srca);
v44 = v45;
src = (char *)this->dword7C;
n = dword80 - src;
v43 = (char *)v45 + (v60 & 0xFFFFFFFC);
if ( dword80 != src )
{
LABEL_94:
v78 = (size_t)v44;
v45 = (HDDMTileType **)((char *)memmove(v44, src, n) + n);
v44 = (HDDMTileType **)v78;
}
LABEL_80:
*v45 = v83;
v46 = v45 + 1;
v47 = this;
dword7C = (void *)this->dword7C;
if ( dword7C )
{
v76 = (size_t)v44;
free(dword7C);
v44 = (HDDMTileType **)v76;
v47 = this;
}
v47->dword7C = v44;
v47->dword80 = v46;
v47->dword84 = v43;
LABEL_37:
*((_WORD *)v83 + 3) = ((_WORD)m << 6) | *((_WORD *)v83 + 3) & 0x3F;
HDDMSiteType::readme_pb(v83, (int)v112, this);
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(
v99,
(int)v83 + 20);
dword1B0 = this->dword1B0;
if ( dword1B0 )
{
v20 = v100;
v21 = v101;
v72 = &this->char1AC;
do
{
while ( stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
*(void **)(dword1B0 + 36),
*(_DWORD *)(dword1B0 + 32),
v21,
v20) >= 0 )
{
v72 = (char *)dword1B0;
dword1B0 = *(_DWORD *)(dword1B0 + 8);
if ( !dword1B0 )
goto LABEL_42;
}
dword1B0 = *(_DWORD *)(dword1B0 + 12);
}
while ( dword1B0 );
LABEL_42:
if ( v72 != &this->char1AC
&& stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
v21,
v20,
*((void **)v72 + 9),
*((_DWORD *)v72 + 8)) >= 0 )
{
goto LABEL_44;
}
}
else
{
v72 = &this->char1AC;
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(v108, (int)v99);
v109 = 0;
v94 = v72;
srca = &this->char1AC;
stlp_std::priv::_Rb_tree<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::less<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>,stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMSiteType *>,stlp_std::priv::_Select1st<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMSiteType *>>,stlp_std::priv::_MapTraitsT<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMSiteType *>>,stlp_std::allocator<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMSiteType *>>>::insert_unique(&v97);
v72 = v97;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v108);
LABEL_44:
*((_DWORD *)v72 + 10) = v83;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v99);
}
}
v22 = v124;
v91 = v124;
stlp_std::vector<HDDMTileType *,stlp_std::allocator<HDDMTileType *>>::reserve(&this->dword88, v124);
if ( v22 > 0 )
{
for ( ii = 0; v91 != ii; ++ii )
{
v23 = (HDDMTileType *)operator new(0x188u);
v84 = v23;
HDDMTileType::HDDMTileType(v23);
dword8C = (char *)this->dword8C;
if ( dword8C != (char *)this->dword90 )
{
*(_DWORD *)dword8C = v23;
this->dword8C += 4;
goto LABEL_49;
}
dword88 = (char *)this->dword88;
v50 = dword8C - dword88;
v51 = 1;
v52 = (dword8C - dword88) >> 2;
if ( v52 )
v51 = (dword8C - dword88) >> 2;
v53 = v52 + v51;
if ( v53 > 0x3FFFFFFF || v52 > v53 )
{
v63 = -4;
}
else
{
if ( !v53 )
{
v54 = 0;
v55 = 0;
v56 = 0;
if ( v50 )
goto LABEL_100;
goto LABEL_89;
}
v63 = 4 * v53;
}
v56 = (HDDMTileType **)stlp_std::__malloc_alloc::allocate((stlp_std::__malloc_alloc *)v63, (unsigned int)srcb);
v55 = v56;
dword88 = (char *)this->dword88;
v50 = dword8C - dword88;
v54 = (char *)v56 + (v63 & 0xFFFFFFFC);
if ( dword8C != dword88 )
{
LABEL_100:
v80 = (size_t)v55;
v56 = (HDDMTileType **)((char *)memmove(v55, dword88, v50) + v50);
v55 = (HDDMTileType **)v80;
}
LABEL_89:
*v56 = v84;
v57 = v56 + 1;
v58 = this;
v59 = (void *)this->dword88;
if ( v59 )
{
v77 = (size_t)v55;
free(v59);
v55 = (HDDMTileType **)v77;
v58 = this;
}
v58->dword88 = v55;
v58->dword8C = v57;
v58->dword90 = v54;
LABEL_49:
HDDMTileType::readme_pb(v84, (int)v112, this);
HDDMTileType::getName((HDDMTileType *)v102);
dword180 = this->dword180;
if ( dword180 )
{
v26 = v103;
v27 = v104;
v73 = &this->char17C;
do
{
while ( stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
*(void **)(dword180 + 36),
*(_DWORD *)(dword180 + 32),
v27,
v26) >= 0 )
{
v73 = (char *)dword180;
dword180 = *(_DWORD *)(dword180 + 8);
if ( !dword180 )
goto LABEL_54;
}
dword180 = *(_DWORD *)(dword180 + 12);
}
while ( dword180 );
LABEL_54:
if ( v73 != &this->char17C
&& stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_compare(
v27,
v26,
*((void **)v73 + 9),
*((_DWORD *)v73 + 8)) >= 0 )
{
goto LABEL_56;
}
}
else
{
v73 = &this->char17C;
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(v110, (int)v102);
v110[6] = 0;
v95 = v73;
srcb = &this->char17C;
stlp_std::priv::_Rb_tree<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::less<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>,stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMTileType *>,stlp_std::priv::_Select1st<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMTileType *>>,stlp_std::priv::_MapTraitsT<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMTileType *>>,stlp_std::allocator<stlp_std::pair<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>> const,HDDMTileType *>>>::insert_unique(&v98);
v73 = v98;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v110);
LABEL_56:
*((_DWORD *)v73 + 10) = v84;
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v102);
}
}
HDDMXng::Architecture::~Architecture((HDDMXng::Architecture *)arch_msg);
isl::iostreams::filtering_stream<boost::iostreams::input,char,stlp_std::char_traits<char>,stlp_std::allocator<char>,boost::iostreams::public_>::~filtering_stream(v111);
}
void __cdecl HDDMDevice::writearch_pb(HDDMDevice *this, int ostream, unsigned __int16 nFileVersion)
{
int v3; // eax
int v4; // edx
int v5; // eax
char v6; // al
_DWORD *v7; // edx
int v8; // edi
int v9; // ebp
int v10; // eax
int v11; // edx
int v12; // edx
char v13; // al
_DWORD *v14; // edx
int v15; // edi
int v16; // ebp
int v17; // eax
int v18; // edx
int v19; // edx
char v20; // al
_DWORD *v21; // edx
int v22; // edi
int v23; // ebp
int v24; // eax
int v25; // edx
int v26; // edx
_DWORD *dword70; // esi
_DWORD *i; // edi
_DWORD *dword80; // edi
_DWORD *j; // esi
_DWORD *dword88; // esi
_DWORD *k; // edi
int v33; // eax
int v34; // eax
int v35; // eax
int v36; // esi
int v37; // esi
int v38; // esi
google::protobuf::internal::RepeatedPtrFieldBase *v39; // [esp+0h] [ebp-14Ch]
google::protobuf::internal::RepeatedPtrFieldBase *v40; // [esp+0h] [ebp-14Ch]
google::protobuf::internal::RepeatedPtrFieldBase *v41; // [esp+0h] [ebp-14Ch]
__int16 v42; // [esp+2Ch] [ebp-120h] BYREF
__int16 v43; // [esp+2Eh] [ebp-11Eh] BYREF
char v44; // [esp+30h] [ebp-11Ch]
_DWORD v45[3]; // [esp+34h] [ebp-118h] BYREF
char v46; // [esp+40h] [ebp-10Ch]
_DWORD v47[3]; // [esp+44h] [ebp-108h] BYREF
char v48; // [esp+50h] [ebp-FCh]
_DWORD v49[3]; // [esp+54h] [ebp-F8h] BYREF
_BYTE v50[4]; // [esp+60h] [ebp-ECh] BYREF
_DWORD *p_dword70; // [esp+64h] [ebp-E8h]
_BYTE v52[4]; // [esp+70h] [ebp-DCh] BYREF
_DWORD *p_dword7C; // [esp+74h] [ebp-D8h]
_BYTE v54[4]; // [esp+80h] [ebp-CCh] BYREF
_DWORD *p_dword88; // [esp+84h] [ebp-C8h]
int v56; // [esp+90h] [ebp-BCh]
void *v57; // [esp+94h] [ebp-B8h]
_BYTE v58[8]; // [esp+A0h] [ebp-ACh] BYREF
int v59; // [esp+A8h] [ebp-A4h]
int v60; // [esp+ACh] [ebp-A0h] BYREF
int v61; // [esp+B0h] [ebp-9Ch]
int v62; // [esp+B4h] [ebp-98h]
int v63; // [esp+B8h] [ebp-94h]
int v64; // [esp+CCh] [ebp-80h] BYREF
int v65; // [esp+D0h] [ebp-7Ch]
int v66; // [esp+D4h] [ebp-78h]
int v67; // [esp+D8h] [ebp-74h]
int v68; // [esp+ECh] [ebp-60h] BYREF
int v69; // [esp+F0h] [ebp-5Ch]
int v70; // [esp+F4h] [ebp-58h]
int v71; // [esp+F8h] [ebp-54h]
int word20; // [esp+10Ch] [ebp-40h]
int v73; // [esp+110h] [ebp-3Ch]
int v74; // [esp+114h] [ebp-38h]
int v75; // [esp+118h] [ebp-34h]
int v76; // [esp+120h] [ebp-2Ch]
if ( nFileVersion > 2u )
{
v36 = stlp_std::endl<char,stlp_std::char_traits<char>>(&stlp_std::cerr);
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v36, "ERROR:");
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v36, "device/devmodel/HDDMDevice.cxx");
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v36, ":");
v37 = stlp_std::priv::__put_num<char,stlp_std::char_traits<char>,long>(v36, 2489);
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v37, ": ");
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v37, "Invalid version number ");
v38 = stlp_std::priv::__put_num<char,stlp_std::char_traits<char>,unsigned long>(v37, nFileVersion);
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::_M_put_nowiden(v38, ", expected 0, 1 or 2.");
stlp_std::endl<char,stlp_std::char_traits<char>>(v38);
}
else
{
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::write(ostream, "xnga", 4);
v42 = nFileVersion | 0x8000;
v43 = 0;
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::write(ostream, &v42, 2);
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::write(ostream, &v43, 2);
HDDMXng::Architecture::Architecture((HDDMXng::Architecture *)v58);
v76 |= 1u;
v3 = v59;
if ( (_UNKNOWN *)v59 == &google::protobuf::internal::kEmptyString )
{
v3 = operator new(0x18u);
*(_DWORD *)(v3 + 16) = v3;
*(_DWORD *)(v3 + 20) = v3;
*(_BYTE *)v3 = 0;
v59 = v3;
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_assign(
v3,
(void *)this->dword38,
this->dword34);
v4 = v76;
word20 = (unsigned __int16)this->word20;
v73 = (this->dword74 - this->dword70) >> 2;
v74 = (this->dword80 - this->dword7C) >> 2;
v5 = (this->dword8C - this->dword88) >> 2;
LOBYTE(v4) = v76 | 0xF0;
v76 = v4;
v75 = v5;
sub_8DB7FA(this, &this->char13C);
v6 = v44;
if ( v44 )
{
v8 = v45[0];
v7 = v45;
}
else
{
v7 = (_DWORD *)v45[0];
v8 = *(_DWORD *)v45[0];
}
v9 = v7[1];
if ( v8 != v9 )
{
do
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(v54, v8);
v12 = v61;
v35 = v62;
if ( v61 >= v62 )
{
if ( v62 == v63 )
{
google::protobuf::internal::RepeatedPtrFieldBase::Reserve(
(google::protobuf::internal::RepeatedPtrFieldBase *)&v60,
v62 + 1);
v35 = v62;
}
v62 = v35 + 1;
v10 = google::protobuf::internal::StringTypeHandlerBase::New(v41);
v11 = v61++;
*(_DWORD *)(v60 + 4 * v11) = v10;
}
else
{
++v61;
v10 = *(_DWORD *)(v60 + 4 * v12);
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_assign(v10, v57, v56);
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v54);
v8 += 24;
}
while ( v9 != v8 );
v6 = v44;
}
if ( v6 )
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::~vector(v45);
sub_8DB7FA(this, &this->char58);
v13 = v46;
if ( v46 )
{
v15 = v47[0];
v14 = v47;
}
else
{
v14 = (_DWORD *)v47[0];
v15 = *(_DWORD *)v47[0];
}
v16 = v14[1];
if ( v16 != v15 )
{
do
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(v54, v15);
v19 = v65;
v34 = v66;
if ( v65 >= v66 )
{
if ( v66 == v67 )
{
google::protobuf::internal::RepeatedPtrFieldBase::Reserve(
(google::protobuf::internal::RepeatedPtrFieldBase *)&v64,
v66 + 1);
v34 = v66;
}
v66 = v34 + 1;
v17 = google::protobuf::internal::StringTypeHandlerBase::New(v40);
v18 = v65++;
*(_DWORD *)(v64 + 4 * v18) = v17;
}
else
{
++v65;
v17 = *(_DWORD *)(v64 + 4 * v19);
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_assign(v17, v57, v56);
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v54);
v15 += 24;
}
while ( v16 != v15 );
v13 = v46;
}
if ( v13 )
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::~vector(v47);
sub_8DB7FA(this, &this->dword64);
v20 = v48;
if ( v48 )
{
v22 = v49[0];
v21 = v49;
}
else
{
v21 = (_DWORD *)v49[0];
v22 = *(_DWORD *)v49[0];
}
v23 = v21[1];
if ( v23 != v22 )
{
do
{
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::basic_string(v54, v22);
v26 = v69;
v33 = v70;
if ( v69 >= v70 )
{
if ( v70 == v71 )
{
google::protobuf::internal::RepeatedPtrFieldBase::Reserve(
(google::protobuf::internal::RepeatedPtrFieldBase *)&v68,
v70 + 1);
v33 = v70;
}
v70 = v33 + 1;
v24 = google::protobuf::internal::StringTypeHandlerBase::New(v39);
v25 = v69++;
*(_DWORD *)(v68 + 4 * v25) = v24;
}
else
{
++v69;
v24 = *(_DWORD *)(v68 + 4 * v26);
}
stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>::_M_assign(v24, v57, v56);
stlp_std::priv::_String_base<char,stlp_std::allocator<char>>::_M_deallocate_block(v54);
v22 += 24;
}
while ( v23 != v22 );
v20 = v48;
}
if ( v20 )
stlp_std::vector<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,stlp_std::allocator<stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>>>::~vector(v49);
HDDMDevice::writeMessage(ostream, v58);
v50[0] = 0;
p_dword70 = &this->dword70;
dword70 = (_DWORD *)this->dword70;
for ( i = (_DWORD *)this->dword74; i != dword70; ++dword70 )
(*(void (__cdecl **)(_DWORD, int, _DWORD))(*(_DWORD *)*dword70 + 12))(*dword70, ostream, nFileVersion);
boost::foreach_detail_::simple_variant<stlp_std::vector<HDDMBelDef *,stlp_std::allocator<HDDMBelDef *>>>::~simple_variant(v50);
v52[0] = 0;
p_dword7C = &this->dword7C;
dword80 = (_DWORD *)this->dword80;
for ( j = (_DWORD *)this->dword7C; dword80 != j; ++j )
HDDMSiteType::writeme_pb(*j, ostream);
boost::foreach_detail_::simple_variant<stlp_std::vector<HDDMSiteType *,stlp_std::allocator<HDDMSiteType *>>>::~simple_variant(v52);
v54[0] = 0;
p_dword88 = &this->dword88;
dword88 = (_DWORD *)this->dword88;
for ( k = (_DWORD *)this->dword8C; k != dword88; ++dword88 )
HDDMTileType::writeme_pb(*dword88, ostream, nFileVersion);
boost::foreach_detail_::simple_variant<stlp_std::vector<HDDMTileType *,stlp_std::allocator<HDDMTileType *>>>::~simple_variant(v54);
stlp_std::basic_ostream<char,stlp_std::char_traits<char>>::flush(ostream);
HDDMXng::Architecture::~Architecture((HDDMXng::Architecture *)v58);
}
}