ch13_反射reflection

本文深入探讨了Go语言中的反射机制,包括基本结构、匿名或嵌入字段的反射、通过反射修改元素值以及调用结构体方法的具体示例。通过实践代码展示了如何使用reflect包进行类型检查和操作。

反射reflection

反射的基本结构

  • 要导入reflect
import (
    "fmt"
    "reflect"
)

type User struct {
    Id   int
    Name string
    Age  int
}

func (u User) Hello() {
    fmt.Println("Hello world.")
}
func Info(o interface{}) {
    t := reflect.TypeOf(o)
    //判断o是否为结构体
    if k := t.Kind(); k != reflect.Struct {
        fmt.Println("这不是个结构体")
        return
    }
    fmt.Println("Type:", t.Name())
    v := reflect.ValueOf(o)
    fmt.Println("Fields:")
    for i := 0; i < t.NumField(); i++ {
        f := t.Field(i)
        val := v.Field(i).Interface()
        fmt.Printf("%6s: %v %v\n", f.Name, f.Type, val) //对于interface{}, %v会打印实际类型的值
    }
    for i := 0; i < t.NumMethod(); i++ {
        m := t.Method(i)
        fmt.Printf("%6s: %v\n", m.Name, m.Type)
    }
}
func main() {
    u := User{1, "OK", 12}
    Info(u)
}

%v the value in a default format
when printing structs, the plus flag (%+v) adds field names
%#v a Go-syntax representation of the value
%T a Go-syntax representation of the type of the value

反射匿名或嵌入字段

  • 通过查看其类型中Anonymous的真假判断是否为匿名字段
type User struct {
    Id   int
    Name string
    Age  int
}
type Manager struct {
    User
    title string
}

func (u User) Hello() {
    fmt.Println("Hello world.")
}

func main() {
    m := Manager{User: User{1, "OK", 13}, title: "233"}
    t := reflect.TypeOf(m)
    //通过Anonymous字段判断是否为匿名字段
    fmt.Printf("%#v\n", t.Field(0))
    fmt.Printf("%#v\n", t.Field(1))
    //取第0号元素里的第0号元素,即User字段里的Id
    fmt.Printf("%#v\n", t.FieldByIndex([]int{0, 0}))
}

输出结果

reflect.StructField{Name:“User”, PkgPath:"", Type:(*reflect.rtype)(0x4c9a00), Tag:"", Offset:0x0, Index:[]int{0}, Anonymous:true}
reflect.StructField{Name:“title”, PkgPath:“main”, Type:(*reflect.rtype)(0x4b6380), Tag:"", Offset:0x20, Index:[]int{1}, Anonymous:false}
reflect.StructField{Name:“Id”, PkgPath:"", Type:(*reflect.rtype)(0x4b5bc0), Tag:"", Offset:0x0, Index:[]int{0}, Anonymous:false}

通过反射修改元素的值

  • 要使用元素的指针
    x := 123
    v := reflect.ValueOf(&x)
    v.Elem().SetInt(999)
    fmt.Println(x)
  • 修改结构体元素示例
type User struct {
    Id   int
    Name string
    Age  int
}

func Set(o interface{}) {
    v := reflect.ValueOf(o)
    //判断v是否为指针
    if v.Kind() != reflect.Ptr {
        fmt.Println("不是指针,无法修改")
        return
    }
    //判断v所指向的值是否可以被修改
    if v.Elem().CanSet() == false {
        fmt.Println("属性为不可修改")
        return
    }
    //取出v的值
    v = v.Elem()
    f := v.FieldByName("Name")
    if f.IsValid() == false {
        fmt.Println("没有找到")
        return
    }
    switch f.Kind() {
    case reflect.Int:
        f.SetInt(1)
    case reflect.String:
        f.SetString("ByeBye")
    }
}
func main() {
    u := User{Id: 55, Name: "Hello", Age: 13}
    Set(&u)
    fmt.Println(u)
}
  • 调用结构体方法示例
type User struct {
    Id   int
    Name string
    Age  int
}

func (u User) Hello(name string) {
    fmt.Println("Hello", name, ", my name is", u.Name)
}
func main() {
    u := User{Id: 55, Name: "Alice", Age: 13}
    v := reflect.ValueOf(u)
    mv := v.MethodByName("Hello")
    args := []reflect.Value{reflect.ValueOf("Bob")}
    mv.Call(args)
}
请仔细阅读和深度思考分析下面函数,绝对保持原始代码的处理流程和步骤不变, 绝对不要遗漏各种条件判断和标志位管理的处理和各种逻辑功能处理, 采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 与C/C++11标准, 绝对不要输出简化代码和处理流程和步骤,推导并重构完整的可编译的所有函数的全部代码 1.保持所有原始功能不变 2.提高执行效率,降低计算复杂度 3.已经给定的结构体名字和元素不要更改,详细的中文注释 4.自动添加中文注释说明功能逻辑 5.不使用 auto,使用显式 for 循环 6.结构体采用32位定义 7.不要使用小函数,保持原始的函数定义 8.严格保持protobuf字段映射关系 函数中的 HDDMXng::Tile::Tile 映射为 message Tile { optional uint32 graphid = 1; optional sint32 tx = 2; optional sint32 ty = 3; optional uint32 firstsiteid = 4; optional string name = 5; } 将 _BYTE tile_msg[8] 映射为 HDDMXng::Tile tile_msg; void __fastcall HDDMTile::readme_pb(HDDMTile *this, std::istream *a2) { google::protobuf::Message *v2; // rdx int dwordC; // eax int v4; // edx _WORD tile_msg[10]; // [rsp+0h] [rbp-48h] BYREF int n0x1000000; // [rsp+14h] [rbp-34h] int dword8; // [rsp+18h] [rbp-30h] int v8; // [rsp+1Ch] [rbp-2Ch] std::string *v9; // [rsp+20h] [rbp-28h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(a2, HDDMDeviceDump::markBuffer, 4); HDDMXng::Tile::Tile((HDDMXng::Tile *)tile_msg); HDDMDevice::readMessage((HDDMDevice *)a2, (std::istream *)tile_msg, v2); LOWORD(this->tileCode) = tile_msg[8] & 0x3FF | this->tileCode & 0xFC00; dwordC = n0x1000000; if ( n0x1000000 > 0x1000000 ) { dwordC = n0x1000000 & 0xFFFFFF; if ( n0x1000000 >> 24 == 1 ) dwordC = -dwordC; } this->tileCode2 = dwordC; v4 = v8; this->tileCode1 = dword8; this->tileCode = (v4 << 10) | this->tileCode & 0x3FF; std::string::assign((std::string *)&this->qword18, v9); HDDMXng::Tile::~Tile((HDDMXng::Tile *)tile_msg); } void __fastcall HDDMTile::writeme_pb(HDDMTile *this, HDDMTile *HDDMTile) { std::string *p__ZN6google8protobuf8internal12kEmptyStringE_1; // rdi const google::protobuf::Message *v3; // rdx __int16 tileCode; // [rsp+0h] [rbp-88h] char v5; // [rsp+1Fh] [rbp-69h] BYREF int tile_msg; // [rsp+20h] [rbp-68h] OVERLAPPED BYREF _DWORD tile_msg_16[8]; // [rsp+30h] [rbp-58h] BYREF std::string *p__ZN6google8protobuf8internal12kEmptyStringE; // [rsp+50h] [rbp-38h] int v9; // [rsp+5Ch] [rbp-2Ch] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write((std::ostream *)HDDMTile, "TILE", 4); HDDMXng::Tile::Tile((HDDMXng::Tile *)tile_msg_16); tileCode = this->tileCode; v9 |= 0xFu; tile_msg_16[4] = tileCode & 0x3FF; tile_msg_16[5] = this->tileCode2; tile_msg_16[6] = this->tileCode1; tile_msg_16[7] = (unsigned int)this->tileCode >> 10; HDDMTile::getName((HDDMTile *)&tile_msg); v9 |= 0x10u; p__ZN6google8protobuf8internal12kEmptyStringE_1 = p__ZN6google8protobuf8internal12kEmptyStringE; if ( p__ZN6google8protobuf8internal12kEmptyStringE == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_1 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_1 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE = p__ZN6google8protobuf8internal12kEmptyStringE_1; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_1, (const std::string *)&tile_msg); std::string::_Rep::_M_dispose(*(_QWORD *)&tile_msg - 24LL, &v5); HDDMDevice::writeMessage((HDDMDevice *)HDDMTile, (std::ostream *)tile_msg_16, v3); HDDMXng::Tile::~Tile((HDDMXng::Tile *)tile_msg_16); } __int64 __fastcall HDDMTile::print(HDDMTile *this, std::ostream *a2, const std::string *a3) { unsigned __int16 v4; // r13 __int64 v5; // r14 __int64 v6; // r14 __int64 v7; // rax unsigned int v8; // r13d unsigned __int8 v9; // r15 __int64 v10; // r14 __int64 v11; // r14 __int64 v12; // r15 __int64 v13; // r15 __int64 v14; // r14 __int64 v15; // r14 __int64 v16; // rax __int64 dword28; // r13 __int64 v18; // rbx __int64 v19; // rbx __int64 v20; // rbx __int64 v21; // rax unsigned int tileCode1; // [rsp+4h] [rbp-44h] unsigned __int8 v24; // [rsp+Bh] [rbp-3Dh] unsigned int tileCode2; // [rsp+Ch] [rbp-3Ch] v4 = this->tileCode & 0x3FF; v5 = std::__ostream_insert<char,std::char_traits<char>>(a2, *(_QWORD *)a3, *(_QWORD *)(*(_QWORD *)a3 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v5, "TILE : ", 7); v6 = std::__ostream_insert<char,std::char_traits<char>>(v5, this->qword18, *(_QWORD *)(this->qword18 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v6, " m_graphid : ", 13); v7 = std::ostream::_M_insert<unsigned long>(v6, v4); std::endl<char,std::char_traits<char>>(v7); tileCode1 = this->tileCode1; tileCode2 = this->tileCode2; v8 = (unsigned int)this->tileCode >> 10; v9 = this->tileCode & 0x1F; v24 = (LOWORD(this->tileCode) >> 6) & 0xF; v10 = std::__ostream_insert<char,std::char_traits<char>>(a2, *(_QWORD *)a3, *(_QWORD *)(*(_QWORD *)a3 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v10, "m_wasted : ", 11); v11 = std::ostream::_M_insert<unsigned long>(v10, v9); std::__ostream_insert<char,std::char_traits<char>>(v11, " m_tx : ", 8); v12 = std::ostream::operator<<(v11, tileCode2); std::__ostream_insert<char,std::char_traits<char>>(v12, " m_wasted1 : ", 13); v13 = std::ostream::operator<<(v12, 1); std::__ostream_insert<char,std::char_traits<char>>(v13, " m_deviceid : ", 14); v14 = std::ostream::_M_insert<unsigned long>(v13, v24); std::__ostream_insert<char,std::char_traits<char>>(v14, " m_firstsiteid : ", 17); v15 = std::ostream::_M_insert<unsigned long>(v14, v8); std::__ostream_insert<char,std::char_traits<char>>(v15, " m_ty : ", 8); v16 = std::ostream::operator<<(v15, tileCode1); std::endl<char,std::char_traits<char>>(v16); dword28 = (unsigned int)this->dword28; LOWORD(v15) = HDDMTile::getGridPointX(this); LOWORD(v13) = HDDMTile::getGridPointY(this); v18 = std::__ostream_insert<char,std::char_traits<char>>(a2, *(_QWORD *)a3, *(_QWORD *)(*(_QWORD *)a3 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(v18, "tilerow: ", 9); v19 = std::ostream::_M_insert<unsigned long>(v18, (unsigned __int16)v13); std::__ostream_insert<char,std::char_traits<char>>(v19, " tilecol : ", 11); v20 = std::ostream::_M_insert<unsigned long>(v19, (unsigned __int16)v15); std::__ostream_insert<char,std::char_traits<char>>(v20, " index : ", 9); v21 = std::ostream::_M_insert<unsigned long>(v20, dword28); return std::endl<char,std::char_traits<char>>(v21); }
11-07
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 特别注意: 1.确保所有函数调用和逻辑完整保留 2.提高执行效率,降低计算复杂度 3.详细的注释,使用中文 4.不使用auto,使用显式for循环 5.结构体采用32位定义 6.不拆分函数 7.严格保持protobuf字段映射关系 8.使用protobuf反射方式读取数据 函数中的 HDDMXng::TileType::TileType 映射为 message TileType { optional uint32 numarcs = 1; optional uint32 gidx = 2; optional uint32 numwires = 3; optional sint32 xmin = 4; optional sint32 xmax = 5; optional sint32 ymin = 6; optional sint32 ymax = 7; optional uint32 xgridextent = 8; optional uint32 ygridextent = 9; optional string gname = 10; optional string hwname = 11; repeated SiteChildDef sitechilddefs = 12; repeated sint32 sitepin2wire = 13 [packed = true]; optional uint32 numtileports = 14; } message SiteChildDef { optional uint32 sitetype = 1; optional string sitename = 2; optional uint32 startpin = 3; optional uint32 deltarpmx = 4; optional uint32 deltarpmy = 5; } message TilePort { optional uint32 edgeid = 1; optional uint32 faceid = 2; optional uint32 localid = 3; optional uint32 globalid = 4; optional sint32 wireid = 5; } 将 _BYTE tileType_msg[16] 映射为 HDDMXng::TileType tileType_msg; void __fastcall HDDMTileType::readme_pb( HDDMTileType *this, std::istream *stream, HDDMDevice *hddmDevice, __int64 a4, _QWORD *a5) { google::protobuf::Message *v6; // rdx __int16 v7; // dx std::string *v8; // rsi __int16 v9; // ax int n0x7FFFFFFF; // edx char v11; // al int n0x7FFFFFFF_2; // edx int n0x7FFFFFFF_4; // edx bool v14; // zf __int16 word18; // ax int n0x7FFFFFFF_6; // edx __int16 word1A; // ax unsigned __int64 v18; // rbx __int64 qwordC0; // rdx unsigned __int64 v20; // rax __int64 *qwordB0; // rbp __int64 qwordA8; // rdx unsigned __int64 v23; // rax __int64 *qwordB0_3; // r13 __int64 *qwordB0_1; // rbx void *p__ZNSs4_Rep20_S_empty_rep_storageE; // rdi __int64 v27; // rbp __int64 qword38_1; // rax __int64 v29; // rax __int64 v30; // rax __int64 v31; // rbx HDDMTilePort **hddmTilePortVec; // rax __int64 v33; // r12 int word1C_1; // ebx __int64 v35; // rbp __int64 v36; // rbp int word2_1; // ebx __int64 v38; // r12 int v39; // r13d __int64 v40; // rbp int word1C_2; // r12d _WORD *ushortVec; // rdx int v43; // eax int v44; // esi __int64 qword200; // rdx char *p_char1F8; // rsi __int64 p_char1F8_1; // rax __int64 v48; // rdx char v49; // al int v50; // r14d HDDMTileFace *v51; // rbx HDDMWire *v52; // rbp HDDMTilePort *v53; // r12 HDDMTilePort **v54; // rax __int64 v55; // rax google::protobuf::Message *v56; // rdx __int64 *qwordB0_2; // r14 __int64 v58; // rax void *p__ZNSs4_Rep20_S_empty_rep_storageE_1; // rdi int v60; // edx unsigned int hddmDeviceb; // [rsp+0h] [rbp-1A8h] unsigned int v64; // [rsp+10h] [rbp-198h] __int64 v65; // [rsp+18h] [rbp-190h] int v66; // [rsp+18h] [rbp-190h] int v67; // [rsp+20h] [rbp-188h] unsigned __int16 v69; // [rsp+3Ch] [rbp-16Ch] unsigned __int16 v70; // [rsp+3Eh] [rbp-16Ah] char v71; // [rsp+5Fh] [rbp-149h] BYREF _QWORD v72[2]; // [rsp+60h] [rbp-148h] BYREF _QWORD v73[2]; // [rsp+70h] [rbp-138h] BYREF HDDMTilePort *v74[2]; // [rsp+80h] [rbp-128h] BYREF _QWORD v75[2]; // [rsp+90h] [rbp-118h] BYREF int v76; // [rsp+A0h] [rbp-108h] int v77; // [rsp+A4h] [rbp-104h] unsigned int hddmDeviceb_1; // [rsp+A8h] [rbp-100h] unsigned int v79; // [rsp+ACh] [rbp-FCh] int word1C_3; // [rsp+B0h] [rbp-F8h] char v81; // [rsp+B8h] [rbp-F0h] _BYTE tileType_msg[16]; // [rsp+C0h] [rbp-E8h] BYREF int word2; // [rsp+D0h] [rbp-D8h] __int16 v84; // [rsp+D4h] [rbp-D4h] int word1C; // [rsp+D8h] [rbp-D0h] int n0x7FFFFFFF_1; // [rsp+DCh] [rbp-CCh] int n0x7FFFFFFF_3; // [rsp+E0h] [rbp-C8h] int n0x7FFFFFFF_5; // [rsp+E4h] [rbp-C4h] int n0x7FFFFFFF_7; // [rsp+E8h] [rbp-C0h] int word18_1; // [rsp+ECh] [rbp-BCh] std::string *v91; // [rsp+F0h] [rbp-B8h] std::string *v92; // [rsp+F8h] [rbp-B0h] int word1A_1; // [rsp+100h] [rbp-A8h] int v94; // [rsp+104h] [rbp-A4h] __int64 v95; // [rsp+108h] [rbp-A0h] int v96; // [rsp+110h] [rbp-98h] __int64 v97; // [rsp+140h] [rbp-68h] int v98; // [rsp+148h] [rbp-60h] int v99; // [rsp+168h] [rbp-40h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 8); if ( !(_BYTE)byte_992F640 && __cxa_guard_acquire(&byte_992F640) ) { dword_992F530 = HDDMTileType::createtypenamemap((HDDMTileType *)&byte_992F640); __cxa_guard_release(&byte_992F640); } HDDMXng::TileType::TileType((HDDMXng::TileType *)tileType_msg); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)tileType_msg, v6); v7 = v84; v8 = v91; HIWORD(this->tileType_code) = word2; v9 = (v7 << 6) | this->tileType_code & 0x3F; n0x7FFFFFFF = 0x7FFFFFFF; LOWORD(this->tileType_code) = v9; LOWORD(this->tileType_code7) = word1C; v11 = v99; if ( (v99 & 8) != 0 ) n0x7FFFFFFF = n0x7FFFFFFF_1; this->tileType_code2 = n0x7FFFFFFF; n0x7FFFFFFF_2 = 0x7FFFFFFF; if ( (v11 & 0x10) != 0 ) n0x7FFFFFFF_2 = n0x7FFFFFFF_3; this->tileType_code3 = n0x7FFFFFFF_2; n0x7FFFFFFF_4 = 0x7FFFFFFF; if ( (v11 & 0x20) != 0 ) n0x7FFFFFFF_4 = n0x7FFFFFFF_5; v14 = (v11 & 0x40) == 0; word18 = word18_1; this->tileType_code4 = n0x7FFFFFFF_4; n0x7FFFFFFF_6 = 0x7FFFFFFF; if ( !v14 ) n0x7FFFFFFF_6 = n0x7FFFFFFF_7; LOWORD(this->tileType_code6) = word18; word1A = word1A_1; this->tileType_code5 = n0x7FFFFFFF_6; HIWORD(this->tileType_code6) = word1A; std::string::assign((std::string *)&this->gname, v8); std::string::assign((std::string *)&this->hwname, v92); HDDMTileType::settypeenum(this); v18 = v96; v67 = v96; std::vector<HDDMSiteType *>::resize(&this->hddmSiteTypeVec, v96); std::vector<unsigned short>::resize(&this->ushortVec, v18); qwordC0 = this->qwordC0; v20 = (this->qwordC8 - qwordC0) >> 2; if ( v18 > v20 ) { std::vector<std::pair<short,short>>::_M_default_append(&this->qwordC0, v18 - v20); } else if ( v18 < v20 ) { this->qwordC8 = qwordC0 + 4 * v18; } qwordB0 = (__int64 *)this->qwordB0; qwordA8 = this->qwordA8; v23 = ((__int64)qwordB0 - qwordA8) >> 3; if ( v18 > v23 ) { std::vector<std::string>::_M_default_append(&this->qwordA8, v18 - v23); } else if ( v18 < v23 ) { qwordB0_3 = (__int64 *)(qwordA8 + 8 * v18); if ( qwordB0 != qwordB0_3 ) { if ( &_pthread_key_create ) { qwordB0_1 = (__int64 *)(qwordA8 + 8 * v18); do { p__ZNSs4_Rep20_S_empty_rep_storageE = (void *)(*qwordB0_1 - 24); if ( p__ZNSs4_Rep20_S_empty_rep_storageE != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(*qwordB0_1 - 8), 0xFFFFFFFF) <= 0 ) { std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE, v75); } ++qwordB0_1; } while ( qwordB0 != qwordB0_1 ); } else { qwordB0_2 = (__int64 *)(qwordA8 + 8 * v18); do { v58 = *qwordB0_2; p__ZNSs4_Rep20_S_empty_rep_storageE_1 = (void *)(*qwordB0_2 - 24); if ( p__ZNSs4_Rep20_S_empty_rep_storageE_1 != &std::string::_Rep::_S_empty_rep_storage ) { v60 = *(_DWORD *)(v58 - 8); *(_DWORD *)(v58 - 8) = v60 - 1; if ( v60 <= 0 ) std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE_1, v75); } ++qwordB0_2; } while ( qwordB0 != qwordB0_2 ); } } this->qwordB0 = qwordB0_3; } if ( v67 > 0 ) { v27 = 0; do { v29 = *(_QWORD *)(v95 + 8 * v27); *(_QWORD *)(this->hddmSiteTypeVec + 8 * v27) = *(_QWORD *)(hddmDevice->qword90 + 8LL * *(unsigned __int16 *)(v29 + 24)); *(_WORD *)(this->ushortVec + 2 * v27) = *(_DWORD *)(v29 + 28); *(_WORD *)(this->qwordC0 + 4 * v27) = *(_DWORD *)(v29 + 32); *(_WORD *)(this->qwordC0 + 4 * v27 + 2) = *(_DWORD *)(v29 + 36); std::string::assign((std::string *)(this->qwordA8 + 8 * v27), *(const std::string **)(v29 + 16)); std::string::string((std::string *)v72, (const std::string *)(this->qwordA8 + 8 * v27)); v65 = *(_QWORD *)(this->hddmSiteTypeVec + 8 * v27); v30 = operator new(0x40u); *(_QWORD *)v30 = this; *(_DWORD *)(v30 + 8) = (unsigned __int16)v27; v31 = v30; std::string::string((std::string *)(v30 + 16), (const std::string *)v72); *(_QWORD *)(v31 + 40) = 0; *(_QWORD *)(v31 + 48) = 0; *(_QWORD *)(v31 + 56) = 0; *(_QWORD *)(v31 + 32) = v31; *(_QWORD *)(v31 + 24) = v65; v74[0] = (HDDMTilePort *)v31; std::string::_Rep::_M_dispose(v72[0] - 24LL, v75); hddmTilePortVec = (HDDMTilePort **)this->hddmTilePortVec; if ( hddmTilePortVec == (HDDMTilePort **)this->qword40 ) { std::vector<HDDMSiteChildDef *>::_M_emplace_back_aux<HDDMSiteChildDef * const&>(&this->hddmSiteChildDefVec, v74); } else { if ( hddmTilePortVec ) { *hddmTilePortVec = v74[0]; qword38_1 = this->hddmTilePortVec; } else { qword38_1 = 0; } this->hddmTilePortVec = qword38_1 + 8; } std::string::string((std::string *)v75, (const std::string *)(this->qwordA8 + 8 * v27)); v75[1] = v74[0]; std::_Rb_tree<std::string,std::pair<std::string const,HDDMSiteChildDef *>,std::_Select1st<std::pair<std::string const,HDDMSiteChildDef *>>,std::less<std::string>,std::allocator<std::pair<std::string const,HDDMSiteChildDef *>>>::_M_insert_unique<std::pair<std::string,HDDMSiteChildDef *>>( &this->field_48, v75); ++v27; std::string::_Rep::_M_dispose(v75[0] - 24LL, v73); } while ( v67 > (int)v27 ); } HDDMTileType::allocatewires(this, this->tileType_code7); v33 = 0; word1C_1 = 0; if ( LOWORD(this->tileType_code7) ) { do { v35 = this->hddmWireVec + v33; HDDMWire::readme_pb((HDDMWire *)v35, (HDDMWire *)stream, (__int64)hddmDevice, a5); *(_WORD *)(v35 + 10) = word1C_1; std::string::string((std::string *)v73, (const std::string *)(v35 + 32)); *(_WORD *)std::map<std::string,unsigned short>::operator[](this->gap1C0, v73) = word1C_1++; v33 += 88; std::string::_Rep::_M_dispose(v73[0] - 24LL, v75); } while ( LOWORD(this->tileType_code7) > word1C_1 ); } HDDMTileType::allocatearcs(this, HIWORD(this->tileType_code)); v36 = 0; word2_1 = 0; if ( HIWORD(this->tileType_code) ) { do { v38 = this->hddmArcArray + v36; HDDMArc::readme_pb((HDDMArc *)v38, stream, hddmDevice); *(_WORD *)(v38 + 6) = word2_1++; v36 += 24; } while ( HIWORD(this->tileType_code) > word2_1 ); } v39 = v98; std::vector<unsigned short>::resize(&this->qword1A8, v98); v40 = 0; if ( v39 > 0 ) { while ( 1 ) { while ( 1 ) { word1C_2 = *(_DWORD *)(v97 + 4 * v40); if ( word1C_2 >= 0 ) break; LABEL_59: if ( v39 <= (int)++v40 ) goto LABEL_60; } *(_WORD *)(this->qword1A8 + 2 * v40) = word1C_2; if ( (_WORD)v67 ) { ushortVec = (_WORD *)this->ushortVec; v43 = 1; while ( 1 ) { v44 = v43; if ( (unsigned __int16)v40 >= *ushortVec && ((unsigned __int16)v67 == v43 || (unsigned __int16)v40 < ushortVec[1]) ) { break; } ++ushortVec; ++v43; if ( (unsigned __int16)v67 <= v44 ) goto LABEL_47; } v70 = v43 - 1; v69 = v40 - *ushortVec; } LABEL_47: qword200 = this->qword200; LOWORD(v75[0]) = word1C_2; p_char1F8 = (char *)&this->gap1C0[7]; if ( !qword200 ) goto LABEL_75; do { while ( (unsigned __int16)word1C_2 <= *(_WORD *)(qword200 + 32) ) { p_char1F8 = (char *)qword200; qword200 = *(_QWORD *)(qword200 + 16); if ( !qword200 ) goto LABEL_52; } qword200 = *(_QWORD *)(qword200 + 24); } while ( qword200 ); LABEL_52: if ( &this->gap1C0[7] == (_QWORD *)p_char1F8 || (unsigned __int16)word1C_2 < *((_WORD *)p_char1F8 + 16) ) { LABEL_75: v74[0] = (HDDMTilePort *)v75; p_char1F8_1 = std::_Rb_tree<unsigned short,std::pair<unsigned short const,std::pair<unsigned short,unsigned short>>,std::_Select1st<std::pair<unsigned short const,std::pair<unsigned short,unsigned short>>>,std::less<unsigned short>,std::allocator<std::pair<unsigned short const,std::pair<unsigned short,unsigned short>>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&,std::tuple<unsigned short &&>,std::tuple<>>( &this->gap1C0[6], p_char1F8, &qword_7B6AC49, v74, &v71, word1C_2); } else { p_char1F8_1 = (__int64)p_char1F8; } *(_WORD *)(p_char1F8_1 + 34) = v70; *(_WORD *)(p_char1F8_1 + 36) = v69; v48 = 0; if ( LOWORD(this->tileType_code7) > (unsigned __int16)word1C_2 ) v48 = this->hddmWireVec + 88LL * (unsigned __int16)word1C_2; v49 = *(_BYTE *)(*(_QWORD *)(*(_QWORD *)(this->hddmSiteTypeVec + 8LL * v70) + 24LL) + 16LL * v69 + 5) & 0xC0; switch ( v49 ) { case 0: *(_BYTE *)(v48 + 2) |= 5u; goto LABEL_59; case 0x80: ++v40; *(_BYTE *)(v48 + 2) |= 6u; if ( v39 <= (int)v40 ) goto LABEL_60; break; case 0x40: ++v40; *(_BYTE *)(v48 + 2) |= 7u; if ( v39 <= (int)v40 ) goto LABEL_60; break; default: goto LABEL_59; } } } LABEL_60: HDDMTileType::createedgeds(this); HDDMTileType::createwirearcs(this, hddmDevice); HDDMTileType::marknulltiles(this); HDDMTileType::allocatetileports(this); v66 = v94; if ( v94 ) { if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 5); v50 = 0; do { HDDMXng::TilePort::TilePort((HDDMXng::TilePort *)v75); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)v75, v56); hddmDeviceb = hddmDeviceb_1; v64 = v79; if ( (v81 & 0x10) != 0 ) { v51 = *(HDDMTileFace **)(*(_QWORD *)(*(_QWORD *)(this->hddmTileEdgeVec + 8LL * (unsigned __int16)v76) + 24LL) + 8LL * (unsigned __int16)v77); if ( (unsigned __int16)word1C_3 >= LOWORD(this->tileType_code7) ) v52 = 0; else v52 = (HDDMWire *)(this->hddmWireVec + 88LL * (unsigned __int16)word1C_3); } else { v52 = 0; v51 = *(HDDMTileFace **)(*(_QWORD *)(*(_QWORD *)(this->hddmTileEdgeVec + 8LL * (unsigned __int16)v76) + 24LL) + 8LL * (unsigned __int16)v77); } v53 = (HDDMTilePort *)operator new(0x18u); HDDMTilePort::HDDMTilePort(v53, v51, hddmDeviceb, v64, v52); v74[0] = v53; v54 = (HDDMTilePort **)*((_QWORD *)v51 + 4); if ( v54 == *((HDDMTilePort ***)v51 + 5) ) { std::vector<HDDMTilePort *>::_M_emplace_back_aux<HDDMTilePort * const&>((char *)v51 + 24, v74); } else { if ( v54 ) { *v54 = v53; v55 = *((_QWORD *)v51 + 4); } else { v55 = 0; } *((_QWORD *)v51 + 4) = v55 + 8; } if ( v52 ) HDDMWire::addtileport(v52, v74[0]); ++v50; HDDMXng::TilePort::~TilePort((HDDMXng::TilePort *)v75); } while ( v50 != v66 ); } HDDMXng::TileType::~TileType((HDDMXng::TileType *)tileType_msg); } void __fastcall HDDMTileType::writeme_pb(HDDMTileType *this, std::ostream *stream, __int16 a3) { int n0x7FFFFFFF; // ecx int v6; // eax int tileType_code3; // eax int tileType_code6_low; // edx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_3; // rdi __int64 v10; // rax __int64 v11; // r12 __int64 v12; // r14 __int64 v13; // rbx __int64 v14; // rax std::string *p__ZN6google8protobuf8internal12kEmptyStringE_2; // rdi int v16; // eax int v17; // edx int v18; // edx int v19; // edx __int64 qwordA8; // rdx const std::string *v21; // r13 __int64 v22; // rax int v23; // esi __int64 qword1A8; // rax __int64 src_2; // rdx __int64 v26; // rbx __int64 v27; // r13 int v28; // r12d __int64 v29; // rax int v30; // eax __int64 *src_1; // r14 unsigned __int64 v32; // rdi __int64 v33; // r12 int v34; // ebx __int64 v35; // r12 int v36; // ebx void *v37; // rdi google::protobuf::internal::RepeatedPtrFieldBase *v38; // rbp unsigned __int16 ***v39; // rbx unsigned __int16 **v40; // r13 __int64 v41; // r14 unsigned __int16 *v42; // r15 int v43; // eax int v44; // edx int v45; // edx const google::protobuf::Message *v46; // rdx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_4; // rdi google::protobuf::internal::RepeatedPtrFieldBase *v49; // [rsp+10h] [rbp-148h] void *v50; // [rsp+20h] [rbp-138h] BYREF _BYTE *v51; // [rsp+28h] [rbp-130h] __int64 v52; // [rsp+30h] [rbp-128h] _BYTE v53[16]; // [rsp+40h] [rbp-118h] BYREF int v54; // [rsp+50h] [rbp-108h] int v55; // [rsp+54h] [rbp-104h] int v56; // [rsp+58h] [rbp-100h] int v57; // [rsp+5Ch] [rbp-FCh] int v58; // [rsp+60h] [rbp-F8h] int v59; // [rsp+68h] [rbp-F0h] _BYTE v60[16]; // [rsp+70h] [rbp-E8h] BYREF int tileType_code_high; // [rsp+80h] [rbp-D8h] int v62; // [rsp+84h] [rbp-D4h] int tileType_code7_low; // [rsp+88h] [rbp-D0h] int n0x7FFFFFFF_1; // [rsp+8Ch] [rbp-CCh] int tileType_code3_1; // [rsp+90h] [rbp-C8h] int tileType_code4; // [rsp+94h] [rbp-C4h] int tileType_code5; // [rsp+98h] [rbp-C0h] int tileType_code6_low_1; // [rsp+9Ch] [rbp-BCh] std::string *p__ZN6google8protobuf8internal12kEmptyStringE; // [rsp+A0h] [rbp-B8h] std::string *p__ZN6google8protobuf8internal12kEmptyStringE_1; // [rsp+A8h] [rbp-B0h] int tileType_code6_high; // [rsp+B0h] [rbp-A8h] int v72; // [rsp+B4h] [rbp-A4h] __int64 v73; // [rsp+B8h] [rbp-A0h] BYREF int v74; // [rsp+C0h] [rbp-98h] int v75; // [rsp+C4h] [rbp-94h] int v76; // [rsp+C8h] [rbp-90h] void *src; // [rsp+F0h] [rbp-68h] int v78; // [rsp+F8h] [rbp-60h] int v79; // [rsp+FCh] [rbp-5Ch] __int64 v80; // [rsp+100h] [rbp-58h] BYREF int v81; // [rsp+118h] [rbp-40h] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "TILETYPE", 8); HDDMXng::TileType::TileType((HDDMXng::TileType *)v60); n0x7FFFFFFF = this->tileType_code2; tileType_code_high = HIWORD(this->tileType_code); v62 = LOWORD(this->tileType_code) >> 6; tileType_code7_low = LOWORD(this->tileType_code7); v6 = v81 | 7; if ( n0x7FFFFFFF != 0x7FFFFFFF ) { tileType_code3 = this->tileType_code3; n0x7FFFFFFF_1 = n0x7FFFFFFF; tileType_code3_1 = tileType_code3; tileType_code4 = this->tileType_code4; tileType_code5 = this->tileType_code5; v6 = v81 | 0x7F; } tileType_code6_low = LOWORD(this->tileType_code6); p__ZN6google8protobuf8internal12kEmptyStringE_3 = p__ZN6google8protobuf8internal12kEmptyStringE; v81 = v6 | 0x380; tileType_code6_low_1 = tileType_code6_low; tileType_code6_high = HIWORD(this->tileType_code6); if ( p__ZN6google8protobuf8internal12kEmptyStringE == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_3 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_3 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE = p__ZN6google8protobuf8internal12kEmptyStringE_3; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_3, (const std::string *)&this->gname); if ( *((_QWORD *)this->hwname - 3) ) { p__ZN6google8protobuf8internal12kEmptyStringE_4 = p__ZN6google8protobuf8internal12kEmptyStringE_1; v81 |= 0x400u; if ( p__ZN6google8protobuf8internal12kEmptyStringE_1 == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_4 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_4 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE_1 = p__ZN6google8protobuf8internal12kEmptyStringE_4; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_4, (const std::string *)&this->hwname); } v50 = 0; v51 = 0; v52 = 0; if ( a3 ) { HDDMTileType::getAllTilePorts(this, &v50); if ( v51 != v50 ) { v81 |= 0x2000u; v72 = (v51 - (_BYTE *)v50) >> 3; } } v10 = (__int64)(this->qword80 - this->hddmSiteTypeVec) >> 3; if ( (_WORD)v10 ) { v11 = 0; v12 = 2LL * ((unsigned int)(unsigned __int16)v10 - 1) + 2; do { v22 = v74; v23 = v75; if ( v74 >= v75 ) { if ( v75 == v76 ) { google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v73, v75 + 1); v23 = v75; } v75 = v23 + 1; v13 = operator new(0x30u); HDDMXng::SiteChildDef::SiteChildDef((HDDMXng::SiteChildDef *)v13); v14 = v74++; *(_QWORD *)(v73 + 8 * v14) = v13; } else { ++v74; v13 = *(_QWORD *)(v73 + 8 * v22); } p__ZN6google8protobuf8internal12kEmptyStringE_2 = *(std::string **)(v13 + 16); v16 = *(_DWORD *)(v13 + 44); *(_DWORD *)(v13 + 24) = *(_WORD *)(*(_QWORD *)(this->hddmSiteTypeVec + 4 * v11) + 10LL) >> 6; *(_DWORD *)(v13 + 44) = v16 | 1; v17 = *(unsigned __int16 *)(this->ushortVec + v11); *(_DWORD *)(v13 + 44) = v16 | 5; *(_DWORD *)(v13 + 28) = v17; v18 = *(__int16 *)(this->qwordC0 + 2 * v11); *(_DWORD *)(v13 + 44) = v16 | 0xD; *(_DWORD *)(v13 + 32) = v18; v19 = *(__int16 *)(this->qwordC0 + 2 * v11 + 2); *(_DWORD *)(v13 + 44) = v16 | 0x1D; *(_DWORD *)(v13 + 36) = v19; qwordA8 = this->qwordA8; *(_DWORD *)(v13 + 44) = v16 | 0x1F; v21 = (const std::string *)(qwordA8 + 4 * v11); if ( p__ZN6google8protobuf8internal12kEmptyStringE_2 == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_2 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_2 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; *(_QWORD *)(v13 + 16) = p__ZN6google8protobuf8internal12kEmptyStringE_2; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_2, v21); v11 += 2; } while ( v11 != v12 ); } qword1A8 = this->qword1A8; src_2 = (this->qword1B0 - qword1A8) >> 1; if ( (_WORD)src_2 ) { v26 = 0; v27 = 2LL * ((unsigned int)(unsigned __int16)src_2 - 1) + 2; while ( 1 ) { v28 = *(unsigned __int16 *)(qword1A8 + v26); v29 = v78; if ( v78 == v79 ) { v30 = v78 + 1; src_1 = (__int64 *)src; if ( 2 * v78 >= v78 + 1 ) v30 = 2 * v78; v79 = v30; v32 = 4LL * v30; if ( (unsigned __int64)v30 > 0x1FC0000000000000LL ) v32 = -1; src = (void *)operator new[](v32); memcpy(src, src_1, 4LL * v78); if ( src_1 != &v80 && src_1 ) operator delete[](src_1); v29 = v78; } v26 += 2; v78 = v29 + 1; src_2 = (__int64)src; *((_DWORD *)src + v29) = v28; if ( v26 == v27 ) break; qword1A8 = this->qword1A8; } } HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v60, (const google::protobuf::Message *)src_2); v33 = 0; v34 = 0; if ( LOWORD(this->tileType_code7) ) { do { HDDMWire::writeme_pb(this->hddmWireVec + v33, stream); ++v34; v33 += 88; } while ( LOWORD(this->tileType_code7) > v34 ); } v35 = 0; v36 = 0; if ( HIWORD(this->tileType_code) ) { do { HDDMArc::writeme_pb(this->hddmArcArray + v35, stream); ++v36; v35 += 24; } while ( HIWORD(this->tileType_code) > v36 ); } v37 = v51; v38 = (google::protobuf::internal::RepeatedPtrFieldBase *)v50; if ( v51 != v50 ) { v49 = (google::protobuf::internal::RepeatedPtrFieldBase *)v51; if ( HDDMDeviceDump::useXngMarks && (std::ostream::write(stream, "PORTS", 5), v38 = (google::protobuf::internal::RepeatedPtrFieldBase *)v50, v49 = (google::protobuf::internal::RepeatedPtrFieldBase *)v51, v50 == v51) ) { v37 = v50; } else { do { v39 = *(unsigned __int16 ****)v38; v40 = **(unsigned __int16 ****)v38; v41 = *(_QWORD *)(*(_QWORD *)v38 + 16LL); v42 = *v40; HDDMXng::TilePort::TilePort((HDDMXng::TilePort *)v53); v43 = v59; v54 = *v42; v59 |= 1u; v44 = *((unsigned __int16 *)v40 + 4); v59 = v43 | 3; v55 = v44; v45 = *((_DWORD *)v39 + 2); v59 = v43 | 7; v56 = v45; v46 = (const google::protobuf::Message *)*((unsigned int *)v39 + 3); v59 = v43 | 0xF; v57 = (int)v46; if ( v41 ) { v46 = (const google::protobuf::Message *)*(unsigned __int16 *)(v41 + 10); v59 = v43 | 0x1F; v58 = (int)v46; } HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v53, v46); v38 = (google::protobuf::internal::RepeatedPtrFieldBase *)((char *)v38 + 8); HDDMXng::TilePort::~TilePort((HDDMXng::TilePort *)v53); } while ( v49 != v38 ); v37 = v50; } } if ( v37 ) operator delete(v37); HDDMXng::TileType::~TileType((HDDMXng::TileType *)v60); }
10-13
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持所有原始功能不变,不要遗漏逻辑细节 2.提高执行效率,降低计算复杂度 3.已经给定的结构体名字和元素不要更改,详细的中文注释 4.自动添加中文注释说明功能逻辑 5.不使用 auto,使用显式 for 循环 6.结构体采用32位定义 7.不要使用小函数,保持原始的函数定义 8.严格保持protobuf字段映射关系 特别注意: 1.函数中有关位操作不变,函数间的位操作一致 2.函数中的 HDDMXng::BelUsageAttrib::BelUsageAttrib 映射为 message BelUsageAttrib { optional uint32 flags = 1; optional uint32 type = 2; optional uint32 bitwidth = 3; optional string attribname = 4; optional sint32 defint = 5; optional double defdouble = 6; optional bool defbool = 7; optional string defstring = 8; repeated sint32 listofints = 9 [packed = true]; repeated double listofdoubles = 10 [packed = true]; repeated bool listofbools = 11 [packed = true]; repeated string listofstrings = 12; optional uint32 precision = 13; } 3.采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 进行编程 将函数中的 _BYTE attrib_msg[24] 映射为 HDDMXng::BelUsageAttrib attrib_msg 仔细解析 _BYTE attrib_msg[24] 所有字段 void __fastcall HDDMBelUsageAttrib::readme_pb(HDDMBelUsageAttrib *this, std::istream *stream, HDDMDevice *hddmDevice) { google::protobuf::Message *v4; // rdx unsigned int v5; // ecx bool v6; // zf _QWORD *v7; // r12 _QWORD *qword30_1; // rbp unsigned __int64 v9; // r15 _QWORD *qword28_8; // r13 __int64 v11; // rbp __int64 v12; // rax __int64 v13; // rcx __int64 v14; // rdi unsigned __int64 v15; // rdx int v16; // esi __int64 v17; // rsi __int64 v18; // rcx int v19; // r8d int v20; // r9d void *n_23; // r14 char *s2_4; // rbp __int64 qword48_3; // r13 char *p_char40_6; // r15 int v25; // eax unsigned __int64 n_24; // r12 size_t n_9; // rdx __int64 n0x7FFFFFFF_3; // r12 unsigned __int64 n_25; // rcx size_t n_10; // rdx int v31; // eax __int64 p_char40_7; // rax int v33; // eax __int64 *qword28_9; // rax unsigned __int64 v35; // rdx unsigned __int64 v36; // rsi __int64 v37; // r12 __int64 qword28_10; // rax __int64 qword28_6; // r13 unsigned __int64 n_6; // r14 char *s_2; // rbp __int64 qword48_6; // r8 signed __int64 v43; // r9 __int64 v44; // rax char *v45; // r15 __int64 v46; // r12 int v47; // edi char v48; // si __int64 *v49; // rdi __int64 v50; // rax __int64 v51; // rax void *n_19; // r13 __int64 *s2_3; // rbp __int64 qword48_2; // r14 char *p_char40_4; // r15 int v56; // eax unsigned __int64 n_20; // r12 size_t n_7; // rdx __int64 n0x7FFFFFFF_2; // r12 unsigned __int64 n_21; // rcx size_t n_8; // rdx int v62; // eax __int64 p_char40_5; // rax int v64; // r13d char **qword28_7; // rax unsigned __int64 v66; // rdx unsigned __int64 v67; // rsi unsigned __int64 v68; // r13 _QWORD *qword28_5; // rax _QWORD *qword28_3; // r12 unsigned __int64 n_3; // r13 char *s_1; // rax char *v73; // r14 char *s_4; // rbp signed __int64 v75; // r9 __int64 qword48_5; // r8 void *n_15; // r14 __int64 *s2_2; // rbp __int64 qword48_1; // r13 char *p_char40_2; // r15 int v81; // eax unsigned __int64 n_16; // r12 size_t n_4; // rdx __int64 n0x7FFFFFFF_1; // r12 unsigned __int64 n_17; // rcx size_t n_5; // rdx int v87; // eax __int64 p_char40_3; // rax char **qword28_4; // rax unsigned __int64 v90; // rdx unsigned __int64 v91; // rsi unsigned __int64 v92; // r13 _QWORD *qword28_1; // rax _QWORD *qword28_2; // r12 unsigned __int64 n; // r13 char *s; // rax char *v97; // r14 char *s_3; // rbp __int64 qword48; // r8 signed __int64 v100; // r9 __int64 v101; // rcx void *n_11; // r14 __int64 *s2_1; // rbp __int64 qword48_4; // r13 char *p_char40; // r15 int v106; // eax unsigned __int64 n_12; // r12 size_t n_1; // rdx __int64 n0x7FFFFFFF; // r12 unsigned __int64 n_13; // rcx size_t n_2; // rdx int v112; // eax __int64 p_char40_1; // rax char **qword28; // rax unsigned __int64 v115; // rdx unsigned __int64 v116; // rsi signed __int64 v117; // r9 int v118; // eax int v119; // ecx int v120; // edx unsigned __int64 v121; // [rsp+0h] [rbp-1E8h] unsigned __int64 v122; // [rsp+0h] [rbp-1E8h] int v123; // [rsp+0h] [rbp-1E8h] int v124; // [rsp+0h] [rbp-1E8h] unsigned __int64 v125; // [rsp+8h] [rbp-1E0h] unsigned __int64 v126; // [rsp+8h] [rbp-1E0h] unsigned __int64 n_26; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_22; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_18; // [rsp+20h] [rbp-1C8h] unsigned __int64 n_14; // [rsp+20h] [rbp-1C8h] void **s1_1; // [rsp+40h] [rbp-1A8h] BYREF void **s1_2; // [rsp+50h] [rbp-198h] BYREF void **s1_3; // [rsp+60h] [rbp-188h] BYREF void **s2_5; // [rsp+70h] [rbp-178h] BYREF void *s1_4[2]; // [rsp+80h] [rbp-168h] BYREF __int64 v136; // [rsp+90h] [rbp-158h] BYREF void *s1_5[2]; // [rsp+A0h] [rbp-148h] BYREF __int64 v138; // [rsp+B0h] [rbp-138h] BYREF void *s1[2]; // [rsp+C0h] [rbp-128h] BYREF __int64 v140; // [rsp+D0h] [rbp-118h] BYREF void *s2[2]; // [rsp+E0h] [rbp-108h] BYREF char v142; // [rsp+F0h] [rbp-F8h] BYREF _BYTE attrib_msg[24]; // [rsp+100h] [rbp-E8h] BYREF int v144; // [rsp+118h] [rbp-D0h] __int64 v145; // [rsp+120h] [rbp-C8h] int v146; // [rsp+130h] [rbp-B8h] __int64 v147; // [rsp+138h] [rbp-B0h] int v148; // [rsp+148h] [rbp-A0h] __int64 v149; // [rsp+150h] [rbp-98h] int v150; // [rsp+168h] [rbp-80h] __int64 v151; // [rsp+170h] [rbp-78h] __int64 v152; // [rsp+178h] [rbp-70h] _QWORD *v153; // [rsp+180h] [rbp-68h] unsigned int v154; // [rsp+188h] [rbp-60h] char v155; // [rsp+18Ch] [rbp-5Ch] __int16 v156; // [rsp+190h] [rbp-58h] int v157; // [rsp+194h] [rbp-54h] __int64 qword30; // [rsp+198h] [rbp-50h] char v159; // [rsp+1A0h] [rbp-48h] char v160; // [rsp+1A4h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)attrib_msg, v4); v5 = (4 * ((v154 >> 3) & 1)) | (2 * ((v154 >> 2) & 1)) & 0xFFFFFFBB | ((v154 & 2) != 0) | HIBYTE(this->attrib_flags) & 0xB8 | (((v154 >> 4) & 1) << 6); BYTE1(this->attrib_type) = ((unsigned __int8)(v154 >> 7) << 7) | (((v154 & 0x40) != 0) << 6) & 0x7F | (32 * ((v154 & 0x20) != 0)) & 0x7F | BYTE1(this->attrib_type) & 0x1F; v6 = (attrib_msg[16] & 0x10) == 0; HIBYTE(this->attrib_flags) = (8 * (v155 & 7)) | v5 & 0xC7; if ( !v6 ) LOWORD(this->attrib_flags) = v156 & 0xFFF | this->attrib_flags & 0xF000; std::string::_M_assign(&this->attrib_name, v152); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: v92 = v144; qword28_1 = (_QWORD *)operator new(0x18u); qword28_2 = qword28_1; *qword28_1 = 0; qword28_1[1] = 0; qword28_1[2] = 0; if ( !v92 ) { v119 = v144; qword28_1[2] = 0; qword28_1[1] = 0; this->qword28 = qword28_1; if ( v119 <= 0 ) goto LABEL_158; goto LABEL_163; } if ( v92 > 0x3FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n = 4 * v92; s = (char *)operator new(n); v97 = &s[n]; *qword28_2 = s; s_3 = s; qword28_2[2] = &s[n]; memset(s, 0, n); LODWORD(v100) = v144; qword28_2[1] = v97; this->qword28 = qword28_2; if ( (int)v100 <= 0 ) goto LABEL_158; if ( !n ) { LABEL_163: v116 = 0; v115 = 0; LABEL_164: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v116, v115); } v126 = 0; v101 = 0; v124 = 0; while ( 2 ) { *(_DWORD *)&s_3[4 * v101] = *(_DWORD *)(v145 + 4LL * v124 + 8); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s1_4, this, v124, v101, qword48, v100); qword48 = this->qword48; if ( !qword48 ) { p_char40 = (char *)&this->qword40; goto LABEL_149; } n_11 = s1_4[1]; s2_1 = (__int64 *)s1_4[0]; qword48_4 = this->qword48; p_char40 = (char *)&this->qword40; do { while ( 1 ) { n_12 = *(_QWORD *)(qword48_4 + 40); n_1 = (size_t)n_11; if ( n_12 <= (unsigned __int64)n_11 ) n_1 = *(_QWORD *)(qword48_4 + 40); if ( !n_1 ) break; v106 = memcmp(*(const void **)(qword48_4 + 32), s2_1, n_1); if ( !v106 ) break; if ( v106 < 0 ) goto LABEL_122; LABEL_115: p_char40 = (char *)qword48_4; qword48_4 = *(_QWORD *)(qword48_4 + 16); if ( !qword48_4 ) goto LABEL_123; } n0x7FFFFFFF = n_12 - (_QWORD)n_11; if ( n0x7FFFFFFF > 0x7FFFFFFF || n0x7FFFFFFF >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF >= 0 ) goto LABEL_115; LABEL_122: qword48_4 = *(_QWORD *)(qword48_4 + 24); } while ( qword48_4 ); LABEL_123: if ( p_char40 == (char *)&this->qword40 ) goto LABEL_149; n_13 = *((_QWORD *)p_char40 + 5); n_2 = (size_t)n_11; if ( n_13 <= (unsigned __int64)n_11 ) n_2 = *((_QWORD *)p_char40 + 5); if ( n_2 && (n_14 = *((_QWORD *)p_char40 + 5), v112 = memcmp(s2_1, *((const void **)p_char40 + 4), n_2), n_13 = n_14, v112) ) { if ( v112 >= 0 ) goto LABEL_129; LABEL_149: s1_1 = s1_4; p_char40_1 = sub_F187E0(&this->qword38, p_char40, &s1_1); s2_1 = (__int64 *)s1_4[0]; } else { p_char40_1 = (__int64)p_char40; v100 = (signed __int64)n_11 - n_13; if ( (__int64)((__int64)n_11 - n_13) <= 0x7FFFFFFF ) { if ( v100 < (__int64)0xFFFFFFFF80000000LL || (int)v100 < 0 ) goto LABEL_149; LABEL_129: p_char40_1 = (__int64)p_char40; } } *(_WORD *)(p_char40_1 + 64) = v124; if ( s2_1 != &v136 ) operator delete(s2_1); if ( ++v124 < v144 ) { qword28 = (char **)this->qword28; v101 = ++v126; s_3 = *qword28; v115 = (qword28[1] - *qword28) >> 2; if ( v115 <= v126 ) { v116 = v126; goto LABEL_164; } continue; } break; } LABEL_158: LODWORD(this->qword30) = v157; LABEL_7: if ( (attrib_msg[17] & 1) != 0 ) BYTE1(this->attrib_type) = (4 * (v160 & 7)) | BYTE1(this->attrib_type) & 0xE3 | 2; HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); return; case 2: v68 = v146; qword28_5 = (_QWORD *)operator new(0x18u); qword28_3 = qword28_5; *qword28_5 = 0; qword28_5[1] = 0; qword28_5[2] = 0; if ( v68 ) { if ( v68 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n_3 = 8 * v68; s_1 = (char *)operator new(n_3); v73 = &s_1[n_3]; *qword28_3 = s_1; s_4 = s_1; qword28_3[2] = &s_1[n_3]; memset(s_1, 0, n_3); LODWORD(qword48_5) = v146; qword28_3[1] = v73; this->qword28 = qword28_3; if ( (int)qword48_5 > 0 ) { v125 = 0; if ( n_3 ) { v123 = 0; while ( 1 ) { *(_QWORD *)&s_4[8 * v125] = *(_QWORD *)(v147 + 8LL * v123 + 8); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]( (__int64)s1_5, this, v123, (unsigned int)v123, qword48_5, v75); qword48_5 = this->qword48; if ( !qword48_5 ) { p_char40_2 = (char *)&this->qword40; goto LABEL_153; } n_15 = s1_5[1]; s2_2 = (__int64 *)s1_5[0]; qword48_1 = this->qword48; p_char40_2 = (char *)&this->qword40; do { while ( 1 ) { n_16 = *(_QWORD *)(qword48_1 + 40); n_4 = (size_t)n_15; if ( n_16 <= (unsigned __int64)n_15 ) n_4 = *(_QWORD *)(qword48_1 + 40); if ( !n_4 ) break; v81 = memcmp(*(const void **)(qword48_1 + 32), s2_2, n_4); if ( !v81 ) break; if ( v81 < 0 ) goto LABEL_93; LABEL_86: p_char40_2 = (char *)qword48_1; qword48_1 = *(_QWORD *)(qword48_1 + 16); if ( !qword48_1 ) goto LABEL_94; } n0x7FFFFFFF_1 = n_16 - (_QWORD)n_15; if ( n0x7FFFFFFF_1 > 0x7FFFFFFF || n0x7FFFFFFF_1 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_1 >= 0 ) { goto LABEL_86; } LABEL_93: qword48_1 = *(_QWORD *)(qword48_1 + 24); } while ( qword48_1 ); LABEL_94: if ( p_char40_2 == (char *)&this->qword40 ) goto LABEL_153; n_17 = *((_QWORD *)p_char40_2 + 5); n_5 = (size_t)n_15; if ( n_17 <= (unsigned __int64)n_15 ) n_5 = *((_QWORD *)p_char40_2 + 5); if ( n_5 && (n_18 = *((_QWORD *)p_char40_2 + 5), v87 = memcmp(s2_2, *((const void **)p_char40_2 + 4), n_5), n_17 = n_18, v87) ) { if ( v87 >= 0 ) goto LABEL_100; LABEL_153: s1_2 = s1_5; p_char40_3 = sub_F187E0(&this->qword38, p_char40_2, &s1_2); s2_2 = (__int64 *)s1_5[0]; } else { p_char40_3 = (__int64)p_char40_2; v75 = (signed __int64)n_15 - n_17; if ( (__int64)((__int64)n_15 - n_17) <= 0x7FFFFFFF ) { if ( v75 < (__int64)0xFFFFFFFF80000000LL || (int)v75 < 0 ) goto LABEL_153; LABEL_100: p_char40_3 = (__int64)p_char40_2; } } *(_WORD *)(p_char40_3 + 64) = v123; if ( s2_2 != &v138 ) operator delete(s2_2); if ( v146 <= ++v123 ) goto LABEL_157; qword28_4 = (char **)this->qword28; ++v125; s_4 = *qword28_4; v90 = (qword28_4[1] - *qword28_4) >> 3; if ( v90 <= v125 ) { v91 = v125; goto LABEL_167; } } } LABEL_166: v91 = 0; v90 = 0; LABEL_167: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v91, v90); } } else { v120 = v146; qword28_5[2] = 0; qword28_5[1] = 0; this->qword28 = qword28_5; if ( v120 > 0 ) goto LABEL_166; } LABEL_157: this->qword30 = qword30; goto LABEL_7; case 3: v37 = v148; qword28_10 = operator new(0x28u); *(_QWORD *)qword28_10 = 0; *(_DWORD *)(qword28_10 + 8) = 0; *(_QWORD *)(qword28_10 + 16) = 0; *(_DWORD *)(qword28_10 + 24) = 0; qword28_6 = qword28_10; *(_QWORD *)(qword28_10 + 32) = 0; n_6 = 8 * ((unsigned __int64)(v37 + 63) >> 6); s_2 = (char *)operator new(n_6); *(_QWORD *)qword28_6 = s_2; v44 = v37 + 63; *(_DWORD *)(qword28_6 + 8) = 0; *(_QWORD *)(qword28_6 + 32) = &s_2[n_6]; if ( v37 >= 0 ) v44 = v37; v45 = &s_2[8 * (v44 >> 6)]; v46 = v37 % 64; if ( v46 < 0 ) { v46 += 64; v45 -= 8; } *(_QWORD *)(qword28_6 + 16) = v45; *(_DWORD *)(qword28_6 + 24) = v46; if ( s_2 != &s_2[n_6] ) memset(s_2, 0, n_6); v47 = v148; this->qword28 = qword28_6; if ( v47 <= 0 ) goto LABEL_141; v48 = *(_BYTE *)(v149 + 8); if ( !(v46 + 8 * (v45 - s_2)) ) { v67 = 0; v66 = 0; LABEL_172: std::__throw_out_of_range_fmt( "vector<bool>::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v67, v66); } v122 = 0; LABEL_51: v49 = (__int64 *)&s_2[8 * (v122 >> 6)]; v50 = 1LL << v122; if ( v48 ) v51 = *v49 | v50; else v51 = *v49 & ~v50; *v49 = v51; HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s1, this, v122, v122, qword48_6, v43); qword48_6 = this->qword48; if ( !qword48_6 ) { p_char40_4 = (char *)&this->qword40; goto LABEL_138; } n_19 = s1[1]; s2_3 = (__int64 *)s1[0]; qword48_2 = this->qword48; p_char40_4 = (char *)&this->qword40; while ( 1 ) { while ( 1 ) { n_20 = *(_QWORD *)(qword48_2 + 40); n_7 = (size_t)n_19; if ( n_20 <= (unsigned __int64)n_19 ) n_7 = *(_QWORD *)(qword48_2 + 40); if ( n_7 ) { v56 = memcmp(*(const void **)(qword48_2 + 32), s2_3, n_7); if ( v56 ) break; } n0x7FFFFFFF_2 = n_20 - (_QWORD)n_19; if ( n0x7FFFFFFF_2 > 0x7FFFFFFF || n0x7FFFFFFF_2 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_2 >= 0 ) goto LABEL_57; LABEL_64: qword48_2 = *(_QWORD *)(qword48_2 + 24); if ( !qword48_2 ) { LABEL_65: if ( &this->qword40 == (_QWORD *)p_char40_4 ) goto LABEL_138; n_21 = *((_QWORD *)p_char40_4 + 5); n_8 = (size_t)n_19; if ( n_21 <= (unsigned __int64)n_19 ) n_8 = *((_QWORD *)p_char40_4 + 5); if ( n_8 && (n_22 = *((_QWORD *)p_char40_4 + 5), v62 = memcmp(s2_3, *((const void **)p_char40_4 + 4), n_8), n_21 = n_22, v62) ) { if ( v62 >= 0 ) goto LABEL_71; LABEL_138: s1_3 = s1; p_char40_5 = sub_F187E0(&this->qword38, p_char40_4, &s1_3); s2_3 = (__int64 *)s1[0]; } else { p_char40_5 = (__int64)p_char40_4; v43 = (signed __int64)n_19 - n_21; if ( (__int64)((__int64)n_19 - n_21) <= 0x7FFFFFFF ) { if ( v43 < (__int64)0xFFFFFFFF80000000LL || (int)v43 < 0 ) goto LABEL_138; LABEL_71: p_char40_5 = (__int64)p_char40_4; } } *(_WORD *)(p_char40_5 + 64) = v122; if ( s2_3 != &v140 ) operator delete(s2_3); v64 = v122 + 1; if ( v148 <= (int)v122 + 1 ) { LABEL_141: LOBYTE(this->qword30) = v159; goto LABEL_7; } ++v122; v48 = *(_BYTE *)(v149 + v64 + 8); qword28_7 = (char **)this->qword28; s_2 = *qword28_7; v66 = *((unsigned int *)qword28_7 + 6) + 8 * (qword28_7[2] - *qword28_7) - *((unsigned int *)qword28_7 + 2); if ( v122 >= v66 ) { v67 = v122; goto LABEL_172; } goto LABEL_51; } } if ( v56 < 0 ) goto LABEL_64; LABEL_57: p_char40_4 = (char *)qword48_2; qword48_2 = *(_QWORD *)(qword48_2 + 16); if ( !qword48_2 ) goto LABEL_65; } case 4: case 5: case 6: v9 = v150; v121 = v150; qword28_8 = (_QWORD *)operator new(0x18u); *qword28_8 = 0; qword28_8[1] = 0; qword28_8[2] = 0; if ( v9 ) { if ( v9 > 0x7FFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v11 = 32 * v121; v12 = operator new(32 * v121); v13 = v12 + 32 * v121; v14 = v12; *qword28_8 = v12; qword28_8[1] = v12; v15 = v121; qword28_8[2] = v13; do { if ( v12 ) { *(_QWORD *)(v12 + 8) = 0; *(_BYTE *)(v12 + 16) = 0; *(_QWORD *)v12 = v12 + 16; } v12 += 32; --v15; } while ( v15 ); v16 = v150; v121 = 0; qword28_8[1] = v13; this->qword28 = qword28_8; if ( v16 > 0 ) { v17 = *(_QWORD *)(v151 + 8); if ( v11 ) { while ( 1 ) { std::string::_M_assign(32 * v121 + v14, v17); HDDMBelUsageAttrib::getValueAsString[abi:cxx11]((__int64)s2, this, v121, v18, v19, v20); if ( !this->qword48 ) { p_char40_6 = (char *)&this->qword40; goto LABEL_145; } n_23 = s2[1]; s2_4 = (char *)s2[0]; qword48_3 = this->qword48; p_char40_6 = (char *)&this->qword40; do { while ( 1 ) { n_24 = *(_QWORD *)(qword48_3 + 40); n_9 = (size_t)n_23; if ( n_24 <= (unsigned __int64)n_23 ) n_9 = *(_QWORD *)(qword48_3 + 40); if ( !n_9 ) break; v25 = memcmp(*(const void **)(qword48_3 + 32), s2_4, n_9); if ( !v25 ) break; if ( v25 < 0 ) goto LABEL_29; LABEL_22: p_char40_6 = (char *)qword48_3; qword48_3 = *(_QWORD *)(qword48_3 + 16); if ( !qword48_3 ) goto LABEL_30; } n0x7FFFFFFF_3 = n_24 - (_QWORD)n_23; if ( n0x7FFFFFFF_3 > 0x7FFFFFFF || n0x7FFFFFFF_3 >= (__int64)0xFFFFFFFF80000000LL && (int)n0x7FFFFFFF_3 >= 0 ) { goto LABEL_22; } LABEL_29: qword48_3 = *(_QWORD *)(qword48_3 + 24); } while ( qword48_3 ); LABEL_30: if ( p_char40_6 == (char *)&this->qword40 ) goto LABEL_145; n_25 = *((_QWORD *)p_char40_6 + 5); n_10 = (size_t)n_23; if ( n_25 <= (unsigned __int64)n_23 ) n_10 = *((_QWORD *)p_char40_6 + 5); if ( n_10 && (n_26 = *((_QWORD *)p_char40_6 + 5), v31 = memcmp(s2_4, *((const void **)p_char40_6 + 4), n_10), n_25 = n_26, v31) ) { if ( v31 >= 0 ) goto LABEL_36; LABEL_145: s2_5 = s2; p_char40_7 = sub_F187E0(&this->qword38, p_char40_6, &s2_5); s2_4 = (char *)s2[0]; } else { p_char40_7 = (__int64)p_char40_6; v117 = (signed __int64)n_23 - n_25; if ( (__int64)((__int64)n_23 - n_25) <= 0x7FFFFFFF ) { if ( v117 < (__int64)0xFFFFFFFF80000000LL || (int)v117 < 0 ) goto LABEL_145; LABEL_36: p_char40_7 = (__int64)p_char40_6; } } *(_WORD *)(p_char40_7 + 64) = v121; if ( s2_4 != &v142 ) operator delete(s2_4); v33 = v121 + 1; if ( v150 <= (int)v121 + 1 ) goto LABEL_6; ++v121; v17 = *(_QWORD *)(v151 + 8LL * v33 + 8); qword28_9 = (__int64 *)this->qword28; v14 = *qword28_9; v35 = (qword28_9[1] - *qword28_9) >> 5; if ( v35 <= v121 ) { v36 = v121; goto LABEL_161; } } } LABEL_160: v36 = v121; v35 = 0; LABEL_161: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v36, v35); } } else { v118 = v150; qword28_8[2] = 0; qword28_8[1] = 0; this->qword28 = qword28_8; if ( v118 > 0 ) goto LABEL_160; } LABEL_6: v7 = v153; qword30_1 = (_QWORD *)operator new(0x20u); *qword30_1 = qword30_1 + 2; sub_F12340(qword30_1, *v7, v7[1] + *v7); this->qword30 = qword30_1; goto LABEL_7; default: goto LABEL_7; } } 将函数中的 _BYTE attrib_msg[16] 映射为 HDDMXng::BelUsageAttrib attrib_msg void __fastcall HDDMBelUsageAttrib::writeme_pb(HDDMBelUsageAttrib *this, std::ostream *fileName) { unsigned __int8 attrib_code_high; // dl int v4; // eax int v5; // ecx int v6; // eax char v7; // cl int v8; // esi __int16 attrib_code; // ax int v10; // ecx unsigned __int16 v11; // ax _QWORD *p_attrib_name; // rsi const google::protobuf::Message *v13; // rdx __int64 qword30_2; // xmm0_8 unsigned __int8 v15; // al __int64 *qword28_6; // rax __int64 v17; // r12 __int64 v18; // rax __int64 v19; // r15 unsigned __int64 v20; // r13 int v21; // esi google::protobuf::Arena *v22; // r14 _QWORD *v23; // rax _QWORD *v24; // rbx _QWORD *v25; // rdi __int64 v26; // rax __int64 *qword28_7; // rax unsigned __int64 v28; // rdx _DWORD *v29; // rdx __int64 v30; // r12 __int64 v31; // rcx int v32; // eax __int64 *qword28_4; // rax __int64 v34; // rsi __int64 v35; // rcx __int64 v36; // r13 unsigned __int64 v37; // rbx __int64 *qword28_5; // rax unsigned __int64 v39; // rdx __int64 n4_21; // rax bool v41; // r12 _QWORD *v42; // r15 int n4_8; // edx google::protobuf::Arena *v44; // rdi int n4_7; // eax unsigned __int64 v46; // rdx size_t n; // rdx __int64 n4_12; // rcx __int64 *qword28_2; // rcx __int64 v50; // rax __int64 v51; // rcx __int64 v52; // r13 unsigned __int64 v53; // rbx __int64 *qword28_3; // rdx unsigned __int64 v55; // rdx __int64 v56; // xmm1_8 __int64 n4_19; // rax _QWORD *v58; // r14 int n4_4; // r12d google::protobuf::Arena *v60; // r15 unsigned __int64 v61; // rdx __int64 n4_18; // rax __int64 n4_6; // r15 __int64 *voidVec; // rcx __int64 v65; // rax __int64 v66; // rcx __int64 v67; // r14 unsigned __int64 v68; // rbx __int64 *qword28_1; // rdx unsigned __int64 v70; // rdx int v71; // r12d __int64 n4_16; // rax _QWORD *Aligned_1; // r15 int n4; // r13d google::protobuf::Arena *v75; // rdi unsigned __int64 v76; // rdx __int64 n4_15; // rax __int64 n4_2; // rcx char qword30_4; // al int voidVec1; // eax __int64 qword30_6; // rsi __int64 v82; // rax int n4_11; // eax _QWORD *v84; // rax google::protobuf::internal::RepeatedPtrFieldBase *v85; // [rsp+0h] [rbp-108h] int n4_13; // [rsp+0h] [rbp-108h] google::protobuf::internal::RepeatedPtrFieldBase *v87; // [rsp+0h] [rbp-108h] int n4_3; // [rsp+0h] [rbp-108h] int n4_9; // [rsp+1Ch] [rbp-ECh] _BYTE attrib_msg[16]; // [rsp+20h] [rbp-E8h] BYREF int v92; // [rsp+30h] [rbp-D8h] int n4_14; // [rsp+38h] [rbp-D0h] int n4_1; // [rsp+3Ch] [rbp-CCh] void *Aligned; // [rsp+40h] [rbp-C8h] int n4_17; // [rsp+50h] [rbp-B8h] int n4_5; // [rsp+54h] [rbp-B4h] void *v98; // [rsp+58h] [rbp-B0h] int n4_20; // [rsp+68h] [rbp-A0h] int n4_10; // [rsp+6Ch] [rbp-9Ch] void *v101; // [rsp+70h] [rbp-98h] google::protobuf::Arena *v102; // [rsp+80h] [rbp-88h] BYREF int v103; // [rsp+88h] [rbp-80h] int v104; // [rsp+8Ch] [rbp-7Ch] _DWORD *v105; // [rsp+90h] [rbp-78h] void *p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx; // [rsp+98h] [rbp-70h] BYREF void *p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1; // [rsp+A0h] [rbp-68h] BYREF int v108; // [rsp+A8h] [rbp-60h] int v109; // [rsp+ACh] [rbp-5Ch] int v110; // [rsp+B0h] [rbp-58h] int qword30_1; // [rsp+B4h] [rbp-54h] __int64 qword30_3; // [rsp+B8h] [rbp-50h] char qword30_5; // [rsp+C0h] [rbp-48h] int v114; // [rsp+C4h] [rbp-44h] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(fileName, "BELUSAGEATTRIB", 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); attrib_code_high = HIBYTE(this->attrib_flags); v4 = attrib_code_high & 1; v5 = (_BYTE)v4 == 0 ? 4 : 6; v6 = (v4 << 31 >> 31) & 2; if ( (attrib_code_high & 2) != 0 ) v6 = v5; if ( (attrib_code_high & 4) != 0 ) v6 |= 8u; if ( (attrib_code_high & 0x40) != 0 ) v6 |= 0x10u; v7 = BYTE1(this->attrib_type); if ( (v7 & 0x20) != 0 ) v6 |= 0x20u; if ( (v7 & 0x40) != 0 ) v6 |= 0x40u; v8 = v6; if ( v7 < 0 ) { LOBYTE(v8) = v6 | 0x80; v6 = v8; } v108 = v6; attrib_code = this->attrib_flags; v109 = (attrib_code_high >> 3) & 7; v10 = v92 | 0xC; v11 = attrib_code & 0xFFF; if ( v11 ) { v10 = v92 | 0x1C; v110 = v11; } p_attrib_name = &this->attrib_name; v92 = v10 | 1; if ( p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx == &google::protobuf::internal::fixed_address_empty_string[abi:cxx11] ) sub_E76770(&p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx, p_attrib_name); else std::string::_M_assign(p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx, p_attrib_name); v13 = (const google::protobuf::Message *)HIBYTE(this->attrib_flags); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: voidVec = (__int64 *)this->qword28; if ( !voidVec ) goto LABEL_102; v65 = *voidVec; v66 = (voidVec[1] - *voidVec) >> 2; if ( (int)v66 <= 0 ) goto LABEL_102; if ( !v66 ) { v70 = 0; v68 = 0; LABEL_140: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v68, v70); } v67 = (unsigned int)(v66 - 1); v68 = 0; while ( 2 ) { v71 = *(_DWORD *)(v65 + 4 * v68); n4_16 = n4_14; if ( n4_14 != n4_1 ) goto LABEL_83; Aligned_1 = Aligned; n4 = n4_14 + 1; if ( Aligned ) { v75 = *(google::protobuf::Arena **)Aligned; if ( 2 * n4_14 >= n4 ) n4 = 2 * n4_14; v87 = *(google::protobuf::internal::RepeatedPtrFieldBase **)Aligned; if ( n4 < 4 ) n4 = 4; v76 = 4LL * n4 + 8; if ( v75 ) { Aligned = (void *)google::protobuf::Arena::AllocateAligned(v75, (const type_info *)&`typeinfo for'char, v76); *(_QWORD *)Aligned = v87; n4_15 = n4_14; n4_2 = n4_1; n4_1 = n4; if ( n4_14 <= 0 ) goto LABEL_95; goto LABEL_93; } } else { if ( 2 * n4_14 >= n4 ) n4 = 2 * n4_14; if ( n4 < 4 ) n4 = 4; v76 = 4LL * n4 + 8; } Aligned = (void *)operator new(v76); *(_QWORD *)Aligned = 0; n4_15 = n4_14; n4_2 = n4_1; n4_1 = n4; if ( n4_14 > 0 ) { LABEL_93: n4_3 = n4_2; memcpy((char *)Aligned + 8, Aligned_1 + 1, 4 * n4_15); n4_2 = n4_3; } if ( !Aligned_1 ) goto LABEL_97; LABEL_95: if ( !*Aligned_1 ) operator delete(Aligned_1, 4 * n4_2 + 8); LABEL_97: n4_16 = n4_14; LABEL_83: n4_14 = n4_16 + 1; *((_DWORD *)Aligned + n4_16 + 2) = v71; if ( v68 != v67 ) { qword28_1 = (__int64 *)this->qword28; ++v68; v65 = *qword28_1; v70 = (qword28_1[1] - *qword28_1) >> 2; if ( v70 <= v68 ) goto LABEL_140; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_102: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { voidVec1 = this->qword30; v92 |= 0x20u; qword30_1 = voidVec1; } goto LABEL_25; case 2: qword28_2 = (__int64 *)this->qword28; if ( !qword28_2 ) goto LABEL_21; v50 = *qword28_2; v51 = (qword28_2[1] - *qword28_2) >> 3; if ( (int)v51 <= 0 ) goto LABEL_21; if ( !v51 ) { v55 = 0; v53 = 0; LABEL_138: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v53, v55); } v52 = (unsigned int)(v51 - 1); v53 = 0; while ( 2 ) { v56 = *(_QWORD *)(v50 + 8 * v53); n4_19 = n4_17; if ( n4_17 != n4_5 ) goto LABEL_64; v58 = v98; n4_4 = n4_17 + 1; if ( v98 ) { v60 = *(google::protobuf::Arena **)v98; if ( 2 * n4_17 >= n4_4 ) n4_4 = 2 * n4_17; if ( n4_4 < 4 ) n4_4 = 4; v61 = 8LL * n4_4 + 8; if ( v60 ) { v98 = (void *)google::protobuf::Arena::AllocateAligned( *(google::protobuf::Arena **)v98, (const type_info *)&`typeinfo for'char, v61); *(_QWORD *)v98 = v60; n4_18 = n4_17; n4_6 = n4_5; n4_5 = n4_4; if ( n4_17 <= 0 ) goto LABEL_76; goto LABEL_74; } } else { if ( 2 * n4_17 >= n4_4 ) n4_4 = 2 * n4_17; if ( n4_4 < 4 ) n4_4 = 4; v61 = 8LL * n4_4 + 8; } v98 = (void *)operator new(v61); *(_QWORD *)v98 = 0; n4_18 = n4_17; n4_6 = n4_5; n4_5 = n4_4; if ( n4_17 > 0 ) LABEL_74: memcpy((char *)v98 + 8, v58 + 1, 8 * n4_18); if ( !v58 ) goto LABEL_78; LABEL_76: if ( !*v58 ) operator delete(v58, 8 * n4_6 + 8); LABEL_78: n4_19 = n4_17; LABEL_64: n4_17 = n4_19 + 1; *((_QWORD *)v98 + n4_19 + 1) = v56; if ( v53 != v52 ) { qword28_3 = (__int64 *)this->qword28; ++v53; v50 = *qword28_3; v55 = (qword28_3[1] - *qword28_3) >> 3; if ( v53 >= v55 ) goto LABEL_138; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_21: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword30_2 = this->qword30; v92 |= 0x40u; qword30_3 = qword30_2; } v15 = BYTE1(this->attrib_type); if ( (v15 & 2) != 0 ) { v92 |= 0x100u; v114 = (v15 >> 2) & 7; } goto LABEL_25; case 3: qword28_4 = (__int64 *)this->qword28; if ( !qword28_4 ) goto LABEL_99; v34 = *qword28_4; v35 = *((unsigned int *)qword28_4 + 6) + 8 * (qword28_4[2] - *qword28_4) - *((unsigned int *)qword28_4 + 2); if ( (int)v35 <= 0 ) goto LABEL_99; if ( !v35 ) { v39 = 0; v37 = 0; LABEL_136: std::__throw_out_of_range_fmt( "vector<bool>::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v37, v39); } v36 = (unsigned int)(v35 - 1); v37 = 0; while ( 2 ) { n4_21 = n4_20; v41 = ((1LL << v37) & *(_QWORD *)(v34 + 8 * (v37 >> 6))) != 0; if ( n4_20 != n4_10 ) goto LABEL_45; v42 = v101; n4_8 = n4_20 + 1; if ( v101 ) { v44 = *(google::protobuf::Arena **)v101; if ( 2 * n4_20 >= n4_8 ) n4_8 = 2 * n4_20; n4_7 = 4; v85 = *(google::protobuf::internal::RepeatedPtrFieldBase **)v101; if ( n4_8 >= 4 ) n4_7 = n4_8; n4_9 = n4_7; v46 = n4_7 + 8LL; if ( v44 ) { v101 = (void *)google::protobuf::Arena::AllocateAligned(v44, (const type_info *)&`typeinfo for'char, v46); *(_QWORD *)v101 = v85; n = n4_20; n4_12 = n4_10; n4_10 = n4_9; if ( n4_20 <= 0 ) goto LABEL_57; goto LABEL_55; } } else { if ( 2 * n4_20 >= n4_8 ) n4_8 = 2 * n4_20; n4_11 = 4; if ( n4_8 >= 4 ) n4_11 = n4_8; n4_9 = n4_11; v46 = n4_11 + 8LL; } v84 = (_QWORD *)operator new(v46); n = n4_20; v101 = v84; *v84 = 0; n4_12 = n4_10; n4_10 = n4_9; if ( (int)n > 0 ) { LABEL_55: n4_13 = n4_12; memcpy((char *)v101 + 8, v42 + 1, n); n4_12 = n4_13; } if ( !v42 ) goto LABEL_59; LABEL_57: if ( !*v42 ) operator delete(v42, n4_12 + 8); LABEL_59: n4_21 = n4_20; LABEL_45: n4_20 = n4_21 + 1; *((_BYTE *)v101 + n4_21 + 8) = v41; if ( v36 != v37 ) { qword28_5 = (__int64 *)this->qword28; ++v37; v34 = *qword28_5; v39 = *((unsigned int *)qword28_5 + 6) + 8 * (qword28_5[2] - *qword28_5) - *((unsigned int *)qword28_5 + 2); if ( v39 <= v37 ) goto LABEL_136; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_99: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword30_4 = this->qword30; v92 |= 0x80u; qword30_5 = qword30_4; } LABEL_25: HDDMDevice::writeMessage((HDDMDevice *)fileName, (std::ostream *)attrib_msg, v13); HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)attrib_msg); return; case 4: case 5: case 6: qword28_6 = (__int64 *)this->qword28; if ( !qword28_6 ) goto LABEL_105; v17 = *qword28_6; v18 = (qword28_6[1] - *qword28_6) >> 5; if ( (int)v18 <= 0 ) goto LABEL_105; if ( !v18 ) { v28 = 0; v20 = 0; LABEL_134: std::__throw_out_of_range_fmt( "vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v20, v28); } v19 = (unsigned int)(v18 - 1); v20 = 0; while ( 2 ) { v29 = v105; v21 = v104; v30 = 32 * v20 + v17; if ( !v105 ) goto LABEL_108; v31 = v103; v32 = *v105; if ( v103 >= *v105 ) { v21 = v104; if ( v32 == v104 ) { LABEL_108: google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v102, v21 + 1); v29 = v105; v32 = *v105; } *v29 = v32 + 1; v22 = v102; if ( v102 ) { v23 = (_QWORD *)google::protobuf::Arena::AllocateAligned( v102, (const type_info *)&`typeinfo for'std::string, 0x20u); v24 = v23; if ( v23 ) { v23[1] = 0; *((_BYTE *)v23 + 16) = 0; *v23 = v23 + 2; } google::protobuf::Arena::AddListNode( v22, v23, (void (*)(void *))google::protobuf::internal::arena_destruct_object<std::string>); v25 = v24; } else { v82 = operator new(0x20u); *(_QWORD *)(v82 + 8) = 0; *(_BYTE *)(v82 + 16) = 0; v25 = (_QWORD *)v82; *(_QWORD *)v82 = v82 + 16; } v26 = v103++; *(_QWORD *)&v105[2 * v26 + 2] = v25; } else { ++v103; v25 = *(_QWORD **)&v105[2 * v31 + 2]; } std::string::_M_assign(v25, v30); if ( v20 != v19 ) { qword28_7 = (__int64 *)this->qword28; ++v20; v17 = *qword28_7; v28 = (qword28_7[1] - *qword28_7) >> 5; if ( v28 <= v20 ) goto LABEL_134; continue; } break; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_105: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { v92 |= 2u; qword30_6 = this->qword30; if ( p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1 == &google::protobuf::internal::fixed_address_empty_string[abi:cxx11] ) sub_E76770(&p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1, qword30_6); else std::string::_M_assign(p__ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx_1, qword30_6); } goto LABEL_25; default: goto LABEL_25; } } void __fastcall HDDMBelUsageAttrib::print(HDDMBelUsageAttrib *this, std::ostream *stream, std::string *filename) { char attrib_code_high; // al char v6; // al char n7; // al const char *unknown; // r15 __int64 v9; // r14 size_t v10; // rax __int64 v11; // r14 __int64 v12; // r14 size_t v13; // rax __int64 v14; // rax char v15; // al unsigned __int16 v16; // r14 unsigned __int8 v17; // si char n2; // al _QWORD *qword28_4; // rdx _QWORD *v20; // rax _QWORD *v21; // r13 _QWORD *qword30_1; // rbx char *_[MISMATCH]_2; // rax char *_[MISMATCH]_1; // rax char *_[MISMATCH]; // rax __int64 v26; // rax __int64 v27; // rax __int64 v28; // rax __int64 v29; // rax double **qword28_5; // rdx double *v31; // rax double *v32; // r13 unsigned int **qword28_3; // rdx unsigned int *v34; // rax unsigned int *v35; // r13 unsigned int voidVec1; // ebx __int64 voidVec; // rax _QWORD *v38; // r14 unsigned int n63; // r13d _QWORD *v40; // rcx int n63_1; // edx __int64 qword28_1; // rax __int64 qword28_2; // rax unsigned int voidVec1_low; // ebx char *s; // [rsp+8h] [rbp-60h] char *sa; // [rsp+8h] [rbp-60h] void *v47[2]; // [rsp+10h] [rbp-58h] BYREF _BYTE v48[72]; // [rsp+20h] [rbp-48h] BYREF v47[0] = v48; sub_F12340(v47, "", ""); if ( (this->attrib_flags & 0xFFF) != 0 ) std::string::append(v47, "W"); attrib_code_high = HIBYTE(this->attrib_flags); if ( (attrib_code_high & 4) != 0 ) { std::string::append(v47, "G"); attrib_code_high = HIBYTE(this->attrib_flags); } if ( (attrib_code_high & 0x40) != 0 ) std::string::append(v47, "E"); v6 = BYTE1(this->attrib_type); if ( (v6 & 2) != 0 ) { std::string::append(v47, "P"); v6 = BYTE1(this->attrib_type); } if ( (v6 & 0x40) != 0 ) { std::string::append(v47, "H"); if ( (this->attrib_type & 0x8000) == 0 ) goto LABEL_11; } else if ( v6 >= 0 ) { LABEL_11: n7 = (HIBYTE(this->attrib_flags) >> 3) & 7; goto LABEL_12; } std::string::append(v47, "B"); n7 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n7 == 7 ) { LABEL_15: unknown = "unknown"; s = ""; goto LABEL_17; } LABEL_12: switch ( n7 ) { case 0: unknown = "unsigned"; s = ""; break; case 1: unknown = "int"; s = ""; break; case 2: _[MISMATCH] = ""; unknown = "double"; if ( (*(_QWORD *)&this->attrib_flags & 0xC00000000FFFLL) != 0 ) _[MISMATCH] = " [MISMATCH]"; s = _[MISMATCH]; break; case 3: unknown = "bool"; s = ""; break; case 4: unknown = "string"; s = ""; break; case 5: _[MISMATCH]_1 = ""; unknown = "bithex"; if ( (this->attrib_type & 0x8200) != 0 ) _[MISMATCH]_1 = " [MISMATCH]"; s = _[MISMATCH]_1; break; case 6: _[MISMATCH]_2 = ""; unknown = "bitbinary"; if ( (this->attrib_type & 0x4200) != 0 ) _[MISMATCH]_2 = " [MISMATCH]"; s = _[MISMATCH]_2; break; default: goto LABEL_15; } LABEL_17: v9 = std::__ostream_insert<char,std::char_traits<char>>(stream, *(_QWORD *)filename, *((_QWORD *)filename + 1)); v10 = strlen(unknown); std::__ostream_insert<char,std::char_traits<char>>(v9, unknown, v10); std::__ostream_insert<char,std::char_traits<char>>(v9, "[", 1); v11 = std::__ostream_insert<char,std::char_traits<char>>(v9, v47[0], v47[1]); std::__ostream_insert<char,std::char_traits<char>>(v11, "] ", 2); v12 = std::__ostream_insert<char,std::char_traits<char>>(v11, this->attrib_name, this->attribVoidVec); v13 = strlen(s); std::__ostream_insert<char,std::char_traits<char>>(v12, s, v13); std::endl<char,std::char_traits<char>>(v12); v14 = std::__ostream_insert<char,std::char_traits<char>>(stream, *(_QWORD *)filename, *((_QWORD *)filename + 1)); std::__ostream_insert<char,std::char_traits<char>>(v14, " ", 3); v15 = 0; if ( (this->attrib_flags & 0x2000000) != 0 ) { std::operator<<<std::char_traits<char>>(stream, " (HIDDEN=true)"); v15 = 1; } v16 = this->attrib_flags & 0xFFF; if ( v16 ) { std::__ostream_insert<char,std::char_traits<char>>(stream, " (Width=", 8); v26 = std::ostream::_M_insert<unsigned long>(stream, v16); std::operator<<<std::char_traits<char>>(v26, ")"); v17 = BYTE1(this->attrib_type); if ( (v17 & 2) == 0 ) goto LABEL_49; goto LABEL_48; } v17 = BYTE1(this->attrib_type); if ( (v17 & 2) != 0 ) { LABEL_48: std::__ostream_insert<char,std::char_traits<char>>(stream, " (percision=", 12); v27 = std::ostream::_M_insert<unsigned long>(stream, (v17 >> 2) & 7); std::operator<<<std::char_traits<char>>(v27, ")"); goto LABEL_49; } if ( !v15 ) { n2 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n2 != 2 ) goto LABEL_23; goto LABEL_50; } LABEL_49: v28 = std::endl<char,std::char_traits<char>>(stream); v29 = std::__ostream_insert<char,std::char_traits<char>>(v28, *(_QWORD *)filename, *((_QWORD *)filename + 1)); std::operator<<<std::char_traits<char>>(v29, " "); n2 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n2 != 2 ) { LABEL_23: if ( n2 == 3 ) { std::operator<<<std::char_traits<char>>(stream, " ( "); voidVec = this->qword28; if ( voidVec ) { v38 = *(_QWORD **)voidVec; n63 = *(_DWORD *)(voidVec + 8); v40 = *(_QWORD **)(voidVec + 16); n63_1 = *(_DWORD *)(voidVec + 24); while ( n63 != n63_1 || v38 != v40 ) { while ( 1 ) { std::ostream::_M_insert<bool>(stream, ((1LL << n63) & *v38) != 0); qword28_1 = this->qword28; v40 = *(_QWORD **)(qword28_1 + 16); n63_1 = *(_DWORD *)(qword28_1 + 24); if ( v40 != &v38[(n63 + 1LL) >> 6] || n63_1 != (((_BYTE)n63 + 1) & 0x3F) ) { std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); qword28_2 = this->qword28; n63_1 = *(_DWORD *)(qword28_2 + 24); v40 = *(_QWORD **)(qword28_2 + 16); } if ( n63 == 63 ) break; if ( ++n63 == n63_1 && v38 == v40 ) goto LABEL_74; } ++v38; n63 = 0; } } LABEL_74: if ( (this->attrib_flags & 0x1000000) != 0 ) { voidVec1_low = LOBYTE(this->qword30); std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::_M_insert<bool>(stream, voidVec1_low); } } else if ( n2 == 1 ) { std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_3 = (unsigned int **)this->qword28; if ( qword28_3 ) { v34 = qword28_3[1]; v35 = *qword28_3; while ( v35 != v34 ) { while ( 1 ) { std::ostream::operator<<(stream, *v35++); v34 = *(unsigned int **)(this->qword28 + 8LL); if ( v35 == v34 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v35 == *(unsigned int **)(this->qword28 + 8LL) ) goto LABEL_62; } } } LABEL_62: if ( (this->attrib_flags & 0x1000000) != 0 ) { voidVec1 = this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::operator<<(stream, voidVec1); } } else { std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_4 = (_QWORD *)this->qword28; if ( qword28_4 ) { v20 = (_QWORD *)qword28_4[1]; v21 = (_QWORD *)*qword28_4; while ( v21 != v20 ) { while ( 1 ) { std::__ostream_insert<char,std::char_traits<char>>(stream, *v21, v21[1]); v21 += 4; v20 = *(_QWORD **)(this->qword28 + 8LL); if ( v21 == v20 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v21 == *(_QWORD **)(this->qword28 + 8LL) ) goto LABEL_30; } } } LABEL_30: if ( (this->attrib_flags & 0x1000000) != 0 ) { qword30_1 = (_QWORD *)this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::__ostream_insert<char,std::char_traits<char>>(stream, *qword30_1, qword30_1[1]); } } goto LABEL_32; } LABEL_50: std::operator<<<std::char_traits<char>>(stream, " ( "); qword28_5 = (double **)this->qword28; if ( qword28_5 ) { v31 = qword28_5[1]; v32 = *qword28_5; while ( v32 != v31 ) { while ( 1 ) { std::ostream::_M_insert<double>(stream, *v32++); v31 = *(double **)(this->qword28 + 8LL); if ( v32 == v31 ) break; std::__ostream_insert<char,std::char_traits<char>>(stream, ", ", 2); if ( v32 == *(double **)(this->qword28 + 8LL) ) goto LABEL_55; } } } LABEL_55: if ( (this->attrib_flags & 0x1000000) != 0 ) { sa = (char *)this->qword30; std::__ostream_insert<char,std::char_traits<char>>(stream, " default=", 9); std::ostream::_M_insert<double>(stream, *(double *)&sa); } LABEL_32: std::operator<<<std::char_traits<char>>(stream, " ) "); if ( v47[0] != v48 ) operator delete(v47[0]); } void HDDMBelUsageAttrib::HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { __int16 word4; // ax word4 = this->attrib_type; LOWORD(this->attrib_flags) &= 0xF000u; BYTE2(this->attrib_type) &= 0xF0u; this->attribVoidVec = 0; this->attrib_flags |= 0xFFF000u; LOBYTE(this->qword18) = 0; HIBYTE(this->attrib_flags) = 0; LOWORD(this->attrib_type) = word4 & 0xFE00; BYTE1(this->attrib_type) = 0; HIWORD(this->attrib_type) |= 0xFFF0u; this->attrib_name = (char *)&this->qword18; LODWORD(this->qword40) = 0; this->qword48 = 0; *((_QWORD *)this + 12) = 0; *((_QWORD *)this + 10) = &this->qword40; *((_QWORD *)this + 11) = &this->qword40; this->qword30 = 0; this->qword28 = 0; } void HDDMBelUsageAttrib::~HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { char v2; // al void ***qword28_2; // r12 void **v4; // rbp void **v5; // rbx void **qword30; // rbx __int64 v7; // rax _QWORD *v8; // rdx _QWORD *v9; // r13 _QWORD *v10; // rbp unsigned __int64 v11; // r10 const char *v12; // rsi _QWORD *v13; // r8 _QWORD *v14; // rbx unsigned __int64 v15; // rcx _QWORD *_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins; // r15 unsigned __int64 v17; // rsi __int64 v18; // r10 unsigned __int64 v19; // rtt __int64 v20; // r11 unsigned __int64 v21; // r9 __int64 **v22; // rdx __int64 *i; // rcx __int64 *v24; // rdi __int64 v25; // r8 unsigned __int64 v26; // rdx void **qword28_1; // rbx __int64 qword48; // rsi _QWORD *p_qword38; // rdi _QWORD *p_qword18; // r14 _QWORD *p_qword18_1; // rdi unsigned __int64 v32; // rdx void **qword28; // rbx __int64 v34; // [rsp+8h] [rbp-50h] HDDMBelUsageAttrib *p_this; // [rsp+18h] [rbp-40h] BYREF v2 = (HIBYTE(this->attrib_flags) >> 3) & 7; switch ( v2 ) { case 2: goto LABEL_40; case 3: qword28 = (void **)this->qword28; if ( qword28 ) { if ( *qword28 ) operator delete(*qword28); operator delete(qword28, 0x28u); } goto LABEL_44; case 1: LABEL_40: qword28_1 = (void **)this->qword28; if ( qword28_1 ) { if ( *qword28_1 ) operator delete(*qword28_1); operator delete(qword28_1, 0x18u); } LABEL_44: this->qword28 = 0; goto LABEL_45; } qword28_2 = (void ***)this->qword28; if ( qword28_2 ) { v4 = qword28_2[1]; v5 = *qword28_2; if ( v4 != *qword28_2 ) { do { if ( *v5 != v5 + 2 ) operator delete(*v5); v5 += 4; } while ( v4 != v5 ); v5 = *qword28_2; } if ( v5 ) operator delete(v5); operator delete(qword28_2, 0x18u); this->qword28 = 0; } qword30 = (void **)this->qword30; if ( qword30 ) { if ( *qword30 != qword30 + 2 ) operator delete(*qword30); operator delete(qword30, 0x20u); this->qword30 = 0; p_this = this; if ( !*(_BYTE *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::observers() ) goto LABEL_46; goto LABEL_17; } LABEL_45: p_this = this; if ( !*(_BYTE *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::observers() ) goto LABEL_46; LABEL_17: if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_n2t_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache); } v7 = std::_Hashtable<HDDMBelUsageAttrib const*,std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>,std::allocator<std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>>,std::__detail::_Select1st,std::equal_to<HDDMBelUsageAttrib const*>,boost::hash<HDDMBelUsageAttrib const*>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<true,false,false>>::equal_range( hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache, &p_this); v34 = v7; v9 = v8; if ( (_QWORD *)v7 != v8 ) { v10 = (_QWORD *)v7; while ( 1 ) { if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); } v11 = v10[2]; v12 = (const char *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache[1]; v13 = *(_QWORD **)(*hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + 8 * ((v11 + (v11 >> 3)) % (unsigned __int64)v12)); if ( !v13 ) break; v14 = (_QWORD *)*v13; v15 = *(_QWORD *)(*v13 + 24LL); while ( v11 + (v10[2] >> 3) != v15 || v11 != v14[1] ) { if ( *v14 ) { v15 = *(_QWORD *)(*v14 + 24LL); v13 = v14; v14 = (_QWORD *)*v14; if ( (v11 + (v10[2] >> 3)) % (unsigned __int64)v12 == v15 % (unsigned __int64)v12 ) continue; } goto LABEL_26; } if ( !v13 || !v14 ) break; if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_29; if ( __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) goto LABEL_64; if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_30; LABEL_55: if ( __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); } LABEL_30: _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache; v17 = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache[1]; v18 = *hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache; v19 = v14[3]; v20 = 8 * (v19 % v17); v21 = v19 % v17; v22 = (__int64 **)(*hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + v20); for ( i = *v22; ; i = (__int64 *)*i ) { v24 = (__int64 *)*i; if ( (_QWORD *)*i == v14 ) break; } v25 = *v14; if ( *v22 != i ) { if ( v25 ) { v26 = *(_QWORD *)(v25 + 24) % v17; if ( v21 != v26 ) { *(_QWORD *)(v18 + 8 * v26) = i; v25 = *v14; } } goto LABEL_37; } if ( !v25 ) { if ( i == hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache + 2 ) LABEL_67: _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins[2] = v25; LABEL_62: *v22 = 0; v25 = *v24; goto LABEL_37; } v32 = *(_QWORD *)(v25 + 24) % v17; if ( v21 != v32 ) { *(_QWORD *)(v18 + 8 * v32) = i; v22 = (__int64 **)(*_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins + v20); if ( *v22 == _ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins + 2 ) goto LABEL_67; goto LABEL_62; } LABEL_37: *i = v25; operator delete(v24); --_ZZN3hdi8tcltasks12native_cacheIP18HDDMBelUsageAttribE12t2n_ins[3]; hdi::tcltasks::native_cache_base::mark_invalid(v10[2]); hdi::tcltasks::native_cache_base::decr_refcount(v10[2]); v10 = (_QWORD *)*v10; if ( v9 == v10 ) { if ( !(_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache && __cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache) ) { hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache = hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_n2t_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache); } std::_Hashtable<HDDMBelUsageAttrib const*,std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>,std::allocator<std::pair<HDDMBelUsageAttrib const* const,Tcl_Obj *>>,std::__detail::_Select1st,std::equal_to<HDDMBelUsageAttrib const*>,boost::hash<HDDMBelUsageAttrib const*>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<true,false,false>>::erase( hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::n2t_instance(void)::cache, v34, v9); goto LABEL_46; } } LABEL_26: if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache || !__cxa_guard_acquire(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache) ) { goto LABEL_28; } v14 = 0; LABEL_64: hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache = (_QWORD *)hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::get_t2n_cache(); __cxa_guard_release(&`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache); if ( !v14 ) { LABEL_28: v14 = 0; hdi::tcltasks::native_cache_base::error((hdi::tcltasks::native_cache_base *)"native_cache<> corrupt", v12); } LABEL_29: if ( (_BYTE)`guard variable for'hdi::tcltasks::native_cache<HDDMBelUsageAttrib *>::t2n_instance(void)::cache ) goto LABEL_30; goto LABEL_55; } LABEL_46: qword48 = this->qword48; p_qword38 = &this->qword38; p_qword18 = &this->qword18; std::_Rb_tree<std::string,std::pair<std::string const,unsigned short>,std::_Select1st<std::pair<std::string const,unsigned short>>,std::less<std::string>,std::allocator<std::pair<std::string const,unsigned short>>>::_M_erase( p_qword38, qword48); p_qword18_1 = (_QWORD *)*(p_qword18 - 2); if ( p_qword18_1 != p_qword18 ) operator delete(p_qword18_1); }
10-30
请仔细阅读和分析下面函数,进行优化后,采用C/C++11标准,完整推导并重构可编译的全部代码 要求如下: 1.保持所有原始功能不变,不要遗漏逻辑细节 2.提高执行效率,降低计算复杂度 3.已经给定的结构体名字和元素不要更改,详细的中文注释 4.自动添加中文注释说明功能逻辑 5.不使用 auto,使用显式 for 循环 6.结构体采用32位定义 7.不要使用小函数,保持原始的函数定义 8.严格保持protobuf字段映射关系 特别注意: 1.函数中有关位操作不变,函数间的位操作一致 2.函数中的 HDDMXng::BelUsageAttrib::BelUsageAttrib 映射为 message BelUsageAttrib { optional uint32 flags = 1; optional uint32 type = 2; optional uint32 bitwidth = 3; optional string attribname = 4; optional sint32 defint = 5; optional double defdouble = 6; optional bool defbool = 7; optional string defstring = 8; repeated sint32 listofints = 9 [packed = true]; repeated double listofdoubles = 10 [packed = true]; repeated bool listofbools = 11 [packed = true]; repeated string listofstrings = 12; optional uint32 precision = 13; } 3.采用 google::protobuf::Descriptor 和 google::protobuf::Reflection 进行编程 将函数中的 _BYTE attrib_msg[8] 映射为 HDDMXng::BelUsageAttrib attrib_msg void __fastcall HDDMBelUsageAttrib::HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { __int16 attrib_type; // ax attrib_type = this->attrib_type; LOWORD(this->attrib_flags) &= 0xF000u; BYTE2(this->attrib_type) &= 0xF0u; *(_DWORD *)&this->char28 = 0; this->attrib_flags |= 0xFFF000u; this->qword30 = 0; HIBYTE(this->attrib_flags) = 0; LOWORD(this->attrib_type) = attrib_type & 0xFE00; BYTE1(this->attrib_type) = 0; HIWORD(this->attrib_type) |= 0xFFF0u; this->qword48 = 0; this->qword18 = 0; this->qword10 = 0; this->qword8 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; this->qword38 = &this->char28; this->qword40 = &this->char28; } void __fastcall HDDMBelUsageAttrib::readme_pb(HDDMBelUsageAttrib *this, std::istream *stream, HDDMDevice *hddmDevice) { google::protobuf::Message *v4; // rdx unsigned int v5; // eax bool v6; // zf unsigned __int64 v7; // r12 __int64 *qword10_11; // rax __int64 *qword10_6; // rbp __int64 v10; // rax int v11; // r10d __int64 v12; // rdx const std::string *v13; // rsi unsigned __int64 v14; // rbp __int64 v15; // rdi __int64 *qword10_7; // rax std::string *v17; // r12 std::string *qword18_1; // rbp __int64 v19; // r12 __int64 *qword10_4; // rbp unsigned __int64 v21; // r13 char *s_2; // rax __int64 v23; // rdx char *s_3; // rcx char *v25; // rsi __int64 v26; // r12 int v27; // r11d __int64 v28; // rsi char v29; // r8 __int64 v30; // rbp unsigned __int64 v31; // rcx __int64 v32; // rcx __int64 *qword10_5; // rax __int64 *v34; // rax __int64 v35; // rcx unsigned __int64 v36; // r12 __int64 *qword10_10; // rax __int64 *qword10_2; // rbp __int64 v39; // rax int v40; // r12d __int64 v41; // rdx unsigned __int64 v42; // r12 unsigned __int64 v43; // rax int v44; // ebp __int64 *qword10_3; // rax unsigned __int64 v46; // r12 __int64 *qword10_8; // rax __int64 *qword10_1; // rbp __int64 v49; // rax int v50; // r13d __int64 v51; // rdx unsigned __int64 v52; // r12 unsigned __int64 v53; // rax int v54; // ebp __int64 *qword10; // rax _QWORD *v56; // rdx unsigned __int64 n; // r12 char *s; // rax unsigned __int64 n_1; // r12 char *s_1; // rax HDDMBelUsageAttrib qword10_9; // [rsp+10h] [rbp-178h] BYREF unsigned int v62; // [rsp+60h] [rbp-128h] char v63; // [rsp+64h] [rbp-124h] std::string *v64; // [rsp+68h] [rbp-120h] __int16 v65; // [rsp+70h] [rbp-118h] int v66; // [rsp+74h] [rbp-114h] __int64 qword18; // [rsp+78h] [rbp-110h] std::string *v68; // [rsp+80h] [rbp-108h] __int64 v69; // [rsp+88h] [rbp-100h] int v70; // [rsp+90h] [rbp-F8h] __int64 v71; // [rsp+B0h] [rbp-D8h] int v72; // [rsp+B8h] [rbp-D0h] char v73; // [rsp+E4h] [rbp-A4h] __int16 v74; // [rsp+E8h] [rbp-A0h] char *v75; // [rsp+F0h] [rbp-98h] int v76; // [rsp+F8h] [rbp-90h] const std::string **v77; // [rsp+110h] [rbp-78h] int v78; // [rsp+118h] [rbp-70h] char v79; // [rsp+14Ch] [rbp-3Ch] char v80; // [rsp+14Dh] [rbp-3Bh] if ( HDDMDeviceDump::useXngMarks ) std::istream::read(stream, HDDMDeviceDump::markBuffer, 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)&qword10_9.qword40); HDDMDevice::readMessage((HDDMDevice *)stream, (std::istream *)&qword10_9.qword40, v4); v5 = (((v62 >> 4) & 1) << 6) | (4 * ((v62 >> 3) & 1)) & 0xFFFFFFC7 | (2 * ((v62 >> 2) & 1)) & 0xFFFFFF83 | (v62 >> 1) & 1 | HIBYTE(this->attrib_flags) & 0x80; BYTE1(this->attrib_type) = ((unsigned __int8)(v62 >> 7) << 7) | (((v62 & 0x40) != 0) << 6) & 0x7F | (32 * ((v62 & 0x20) != 0)) & 0x7F | BYTE1(this->attrib_type) & 0x1F; v6 = (v79 & 4) == 0; HIBYTE(this->attrib_flags) = (8 * (v63 & 7)) | v5; if ( !v6 ) LOWORD(this->attrib_flags) = v65 & 0xFFF | this->attrib_flags & 0xF000; std::string::assign((std::string *)&this->qword8, v64); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: v46 = v70; qword10_8 = (__int64 *)operator new(0x18u); qword10_1 = qword10_8; *qword10_8 = 0; qword10_8[1] = 0; qword10_8[2] = 0; if ( v46 ) { if ( v46 > 0x3FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n = 4 * v46; s = (char *)operator new(n); *qword10_1 = (__int64)s; qword10_1[1] = (__int64)s; qword10_1[2] = (__int64)&s[n]; memset(s, 0, n); v49 = qword10_1[2]; } else { qword10_8[2] = 0; v49 = 0; } qword10_1[1] = v49; v50 = v70; this->qword10 = qword10_1; if ( v50 <= 0 ) goto LABEL_50; v51 = *qword10_1; if ( !((qword10_1[1] - *qword10_1) >> 2) ) goto LABEL_65; v52 = 1; v53 = 0; v54 = 0; while ( 1 ) { *(_DWORD *)(v51 + 4 * v53) = *(_DWORD *)(v69 + 4 * v53); HDDMBelUsageAttrib::getValueAsString(&qword10_9, (int)this); *(_WORD *)std::map<HSTString,unsigned short>::operator[](this->p_qword10, &qword10_9) = v54++; std::string::_Rep::_M_dispose(*(_QWORD *)&qword10_9.attrib_flags - 24LL, &qword10_9.qword30); if ( v54 >= v70 ) break; qword10 = (__int64 *)this->qword10; v51 = *qword10; if ( (qword10[1] - *qword10) >> 2 <= v52 ) LABEL_65: std::__throw_out_of_range("vector::_M_range_check"); v53 = v52++; } LABEL_50: LODWORD(this->qword18) = v66; break; case 2: v36 = v72; qword10_10 = (__int64 *)operator new(0x18u); qword10_2 = qword10_10; *qword10_10 = 0; qword10_10[1] = 0; qword10_10[2] = 0; if ( v36 ) { if ( v36 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); n_1 = 8 * v36; s_1 = (char *)operator new(n_1); *qword10_2 = (__int64)s_1; qword10_2[1] = (__int64)s_1; qword10_2[2] = (__int64)&s_1[n_1]; memset(s_1, 0, n_1); v39 = qword10_2[2]; } else { qword10_10[2] = 0; v39 = 0; } qword10_2[1] = v39; v40 = v72; this->qword10 = qword10_2; if ( v40 <= 0 ) goto LABEL_41; v41 = *qword10_2; if ( !((qword10_2[1] - *qword10_2) >> 3) ) goto LABEL_63; v42 = 1; v43 = 0; v44 = 0; while ( 1 ) { *(_QWORD *)(v41 + 8 * v43) = *(_QWORD *)(v71 + 8 * v43); HDDMBelUsageAttrib::getValueAsString((HDDMBelUsageAttrib *)&qword10_9.qword10, (int)this); *(_WORD *)std::map<HSTString,unsigned short>::operator[](this->p_qword10, &qword10_9.qword10) = v44++; std::string::_Rep::_M_dispose(qword10_9.qword10 - 24LL, &qword10_9.qword30); if ( v44 >= v72 ) break; qword10_3 = (__int64 *)this->qword10; v41 = *qword10_3; if ( (qword10_3[1] - *qword10_3) >> 3 <= v42 ) LABEL_63: std::__throw_out_of_range("vector::_M_range_check"); v43 = v42++; } LABEL_41: this->qword18 = qword18; break; case 3: v19 = v76; qword10_4 = (__int64 *)operator new(0x28u); *qword10_4 = 0; *((_DWORD *)qword10_4 + 2) = 0; qword10_4[2] = 0; *((_DWORD *)qword10_4 + 6) = 0; qword10_4[4] = 0; v21 = 8 * ((unsigned __int64)(v19 + 63) >> 6); s_2 = (char *)operator new(v21); v23 = v19 + 63; s_3 = &s_2[v21]; *qword10_4 = (__int64)s_2; *((_DWORD *)qword10_4 + 2) = 0; if ( v19 >= 0 ) v23 = v19; qword10_4[4] = (__int64)s_3; v25 = &s_2[8 * (v23 >> 6)]; v26 = v19 % 64; if ( v26 < 0 ) { LODWORD(v26) = v26 + 64; v25 -= 8; } qword10_4[2] = (__int64)v25; *((_DWORD *)qword10_4 + 6) = v26; if ( s_3 != s_2 ) memset(s_2, 0, 8 * ((v21 - 8) >> 3) + 8); v27 = v76; this->qword10 = qword10_4; if ( v27 <= 0 ) goto LABEL_61; v28 = *qword10_4; v29 = *v75; if ( *((unsigned int *)qword10_4 + 6) + 8 * (qword10_4[2] - *qword10_4) == *((_DWORD *)qword10_4 + 2) ) goto LABEL_64; v30 = 0; v31 = 0; while ( 1 ) { v34 = (__int64 *)(v28 + 8 * (v31 >> 6)); v35 = 1LL << v31; v32 = v29 ? *v34 | v35 : *v34 & ~v35; *v34 = v32; HDDMBelUsageAttrib::getValueAsString((HDDMBelUsageAttrib *)qword10_9.p_qword10, (int)this); *(_WORD *)std::map<HSTString,unsigned short>::operator[](this->p_qword10, qword10_9.p_qword10) = v30; std::string::_Rep::_M_dispose(*(_QWORD *)qword10_9.p_qword10 - 24LL, &qword10_9.qword30); if ( v76 <= (int)v30 + 1 ) break; v31 = v30 + 1; v29 = v75[v30 + 1]; qword10_5 = (__int64 *)this->qword10; v28 = *qword10_5; if ( v30 + 1 >= *((unsigned int *)qword10_5 + 6) + 8 * (qword10_5[2] - *qword10_5) - (unsigned __int64)*((unsigned int *)qword10_5 + 2) ) LABEL_64: std::__throw_out_of_range("vector<bool>::_M_range_check"); ++v30; } LABEL_61: LOBYTE(this->qword18) = v73; break; case 4: case 5: case 6: v7 = v78; qword10_11 = (__int64 *)operator new(0x18u); qword10_6 = qword10_11; *qword10_11 = 0; qword10_11[1] = 0; qword10_11[2] = 0; if ( v7 ) { if ( v7 > 0x1FFFFFFFFFFFFFFFLL ) std::__throw_bad_alloc(); v56 = (_QWORD *)operator new(8 * v7); *qword10_6 = (__int64)v56; qword10_6[1] = (__int64)v56; qword10_6[2] = (__int64)&v56[v7]; do { if ( v56 ) *v56 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; ++v56; --v7; } while ( v7 ); v10 = qword10_6[2]; } else { qword10_11[2] = 0; v10 = 0; } qword10_6[1] = v10; v11 = v78; this->qword10 = qword10_6; if ( v11 <= 0 ) goto LABEL_14; v12 = *qword10_6; v13 = *v77; if ( !((qword10_6[1] - *qword10_6) >> 3) ) goto LABEL_62; v14 = 1; v15 = 0; while ( 1 ) { std::string::assign((std::string *)(v12 + v15), v13); HDDMBelUsageAttrib::getValueAsString((HDDMBelUsageAttrib *)&qword10_9.qword30, (int)this); *(_WORD *)std::map<HSTString,unsigned short>::operator[](this->p_qword10, &qword10_9.qword30) = v14 - 1; std::string::_Rep::_M_dispose(qword10_9.qword30 - 24LL, qword10_9.p_qword10); if ( v78 <= (int)v14 ) break; v15 = 8 * v14; v13 = v77[v14]; qword10_7 = (__int64 *)this->qword10; v12 = *qword10_7; if ( (qword10_7[1] - *qword10_7) >> 3 <= v14 ) LABEL_62: std::__throw_out_of_range("vector::_M_range_check"); ++v14; } LABEL_14: v17 = v68; qword18_1 = (std::string *)operator new(8u); std::string::string(qword18_1, v17); this->qword18 = qword18_1; break; default: break; } if ( (v80 & 0x10) != 0 ) BYTE1(this->attrib_type) = (4 * (v74 & 7)) | BYTE1(this->attrib_type) & 0xE3 | 2; HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)&qword10_9.qword40); } void __fastcall HDDMBelUsageAttrib::writeme_pb(HDDMBelUsageAttrib *this, std::ostream *stream) { unsigned __int8 attrib_flags_high; // dl int v4; // ecx int v5; // eax int v6; // ecx unsigned int v7; // eax char v8; // cl unsigned int v9; // esi int v10; // eax unsigned __int16 v11; // dx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_2; // rdi const google::protobuf::Message *v13; // rdx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_4; // rdi const std::string *qword18_5; // rbx __int64 *qword10_6; // rax __int64 v17; // rcx __int64 v18; // r14 __int64 v19; // r14 __int64 v20; // rbp __int64 v21; // rdx std::string *p__ZN6google8protobuf8internal12kEmptyStringE_3; // rax __int64 v23; // rdx __int64 *qword10_7; // rax __int64 v25; // rax const std::string *v26; // r12 __int64 *qword10_4; // rax __int64 v28; // rsi __int64 v29; // rcx __int64 v30; // rdi __int64 v31; // rax __int64 v32; // rcx __int64 v33; // r14 __int64 v34; // rbp unsigned __int64 v35; // rax __int64 *qword10_5; // rdx bool v37; // zf __int64 n_1; // rax bool v39; // r12 int n_3; // edi __int64 *src_4; // r15 __int64 *qword10_2; // rax __int64 v43; // rcx __int64 v44; // r12 __int64 v45; // r12 __int64 v46; // rbp __int64 v47; // rdx __int64 *qword10_3; // rax __int64 v49; // rax int v50; // eax _BYTE *src_2; // r14 unsigned __int64 v52; // rdi __int64 *qword10; // rax __int64 v54; // rcx __int64 v55; // r14 __int64 v56; // r14 __int64 v57; // rbp __int64 v58; // rdx __int64 *qword10_1; // rax __int64 v60; // rax int v61; // r12d int v62; // eax __int64 *src_1; // r15 unsigned __int64 v64; // rdi char qword18_4; // al int qword18; // eax unsigned __int8 v67; // al __int64 qword18_2; // xmm0_8 int v69; // esi __int64 v70; // [rsp+8h] [rbp-150h] _BYTE v72[16]; // [rsp+20h] [rbp-138h] BYREF unsigned int v73; // [rsp+30h] [rbp-128h] int v74; // [rsp+34h] [rbp-124h] std::string *p__ZN6google8protobuf8internal12kEmptyStringE; // [rsp+38h] [rbp-120h] int v76; // [rsp+40h] [rbp-118h] int qword18_1; // [rsp+44h] [rbp-114h] __int64 qword18_3; // [rsp+48h] [rbp-110h] std::string *p__ZN6google8protobuf8internal12kEmptyStringE_1; // [rsp+50h] [rbp-108h] void *dest; // [rsp+58h] [rbp-100h] int v81; // [rsp+60h] [rbp-F8h] int v82; // [rsp+64h] [rbp-F4h] __int64 v83; // [rsp+68h] [rbp-F0h] BYREF void *dest_1; // [rsp+80h] [rbp-D8h] int v85; // [rsp+88h] [rbp-D0h] int v86; // [rsp+8Ch] [rbp-CCh] _BYTE src_3[40]; // [rsp+90h] [rbp-C8h] BYREF int v88; // [rsp+B8h] [rbp-A0h] void *src; // [rsp+C0h] [rbp-98h] int n; // [rsp+C8h] [rbp-90h] int n_2; // [rsp+CCh] [rbp-8Ch] __int64 v92; // [rsp+D0h] [rbp-88h] BYREF __int64 v93; // [rsp+E0h] [rbp-78h] BYREF int v94; // [rsp+E8h] [rbp-70h] int v95; // [rsp+ECh] [rbp-6Ch] int v96; // [rsp+F0h] [rbp-68h] int v97; // [rsp+11Ch] [rbp-3Ch] if ( HDDMDeviceDump::useXngMarks ) std::ostream::write(stream, "BELUSAGEATTRIB", 14); HDDMXng::BelUsageAttrib::BelUsageAttrib((HDDMXng::BelUsageAttrib *)v72); attrib_flags_high = HIBYTE(this->attrib_flags); v4 = attrib_flags_high & 1; v5 = -((_BYTE)v4 == 0); v6 = (v4 << 31 >> 31) & 2; v7 = (v5 & 0xFFFFFFFE) + 6; if ( (attrib_flags_high & 2) == 0 ) v7 = v6; if ( (attrib_flags_high & 4) != 0 ) v7 |= 8u; if ( (attrib_flags_high & 0x40) != 0 ) v7 |= 0x10u; v8 = BYTE1(this->attrib_type); if ( (v8 & 0x20) != 0 ) v7 |= 0x20u; if ( (v8 & 0x40) != 0 ) v7 |= 0x40u; v9 = v7; if ( v8 < 0 ) { LOBYTE(v9) = v7 | 0x80; v7 = v9; } v73 = v7; v74 = (attrib_flags_high >> 3) & 7; v10 = v97 | 3; v11 = this->attrib_flags & 0xFFF; if ( v11 ) { v76 = v11; v10 = v97 | 7; } p__ZN6google8protobuf8internal12kEmptyStringE_2 = p__ZN6google8protobuf8internal12kEmptyStringE; v97 = v10 | 8; if ( p__ZN6google8protobuf8internal12kEmptyStringE == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_2 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_2 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE = p__ZN6google8protobuf8internal12kEmptyStringE_2; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_2, (const std::string *)&this->qword8); v13 = (const google::protobuf::Message *)HIBYTE(this->attrib_flags); switch ( (HIBYTE(this->attrib_flags) >> 3) & 7 ) { case 1: qword10 = (__int64 *)this->qword10; if ( !qword10 ) goto LABEL_88; v54 = *qword10; v55 = (qword10[1] - *qword10) >> 2; if ( (int)v55 <= 0 ) goto LABEL_88; if ( !v55 ) goto LABEL_97; v56 = (unsigned int)(v55 - 1); v57 = 0; v58 = 0; while ( 1 ) { v60 = v81; v61 = *(_DWORD *)(v54 + 4 * v58); if ( v81 == v82 ) { v62 = v81 + 1; src_1 = (__int64 *)dest; if ( 2 * v81 >= v81 + 1 ) v62 = 2 * v81; v82 = v62; v64 = 4LL * v62; if ( (unsigned __int64)v62 > 0x1FC0000000000000LL ) v64 = -1; dest = (void *)operator new[](v64); memcpy(dest, src_1, 4LL * v81); if ( src_1 != &v83 && src_1 ) operator delete[](src_1); v60 = v81; } v81 = v60 + 1; *((_DWORD *)dest + v60) = v61; if ( v57 == v56 ) break; qword10_1 = (__int64 *)this->qword10; v58 = v57 + 1; v54 = *qword10_1; if ( (qword10_1[1] - *qword10_1) >> 2 <= (unsigned __int64)(v57 + 1) ) LABEL_97: std::__throw_out_of_range("vector::_M_range_check"); ++v57; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_88: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword18 = this->qword18; v97 |= 0x10u; qword18_1 = qword18; } break; case 2: qword10_2 = (__int64 *)this->qword10; if ( !qword10_2 ) goto LABEL_91; v43 = *qword10_2; v44 = (qword10_2[1] - *qword10_2) >> 3; if ( (int)v44 <= 0 ) goto LABEL_91; if ( !v44 ) goto LABEL_98; v45 = (unsigned int)(v44 - 1); v46 = 0; v47 = 0; while ( 1 ) { v49 = v85; v70 = *(_QWORD *)(v43 + 8 * v47); if ( v85 == v86 ) { v50 = v85 + 1; src_2 = dest_1; if ( 2 * v85 >= v85 + 1 ) v50 = 2 * v85; v86 = v50; v52 = 8LL * v50; if ( (unsigned __int64)v50 > 0xFE0000000000000LL ) v52 = -1; dest_1 = (void *)operator new[](v52); memcpy(dest_1, src_2, 8LL * v85); if ( src_2 != src_3 && src_2 ) operator delete[](src_2); v49 = v85; } v85 = v49 + 1; *((_QWORD *)dest_1 + v49) = v70; if ( v46 == v45 ) break; qword10_3 = (__int64 *)this->qword10; v47 = v46 + 1; v43 = *qword10_3; if ( (qword10_3[1] - *qword10_3) >> 3 <= (unsigned __int64)(v46 + 1) ) LABEL_98: std::__throw_out_of_range("vector::_M_range_check"); ++v46; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_91: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword18_2 = this->qword18; v97 |= 0x20u; qword18_3 = qword18_2; } v67 = BYTE1(this->attrib_type); if ( (v67 & 2) != 0 ) { v97 |= 0x1000u; v88 = (v67 >> 2) & 7; } break; case 3: qword10_4 = (__int64 *)this->qword10; if ( !qword10_4 ) goto LABEL_85; v28 = *qword10_4; v29 = qword10_4[2]; v30 = *((unsigned int *)qword10_4 + 6); v31 = *((unsigned int *)qword10_4 + 2); v32 = v30 + 8 * (v29 - v28); if ( (int)v32 - (int)v31 <= 0 ) goto LABEL_85; if ( v32 == v31 ) goto LABEL_96; v33 = (unsigned int)(v32 - v31 - 1); v34 = 0; v35 = 0; while ( 1 ) { v37 = ((1LL << v35) & *(_QWORD *)(v28 + 8 * (v35 >> 6))) == 0; n_1 = n; v39 = !v37; if ( n == n_2 ) { n_3 = 2 * n; src_4 = (__int64 *)src; if ( 2 * n < n + 1 ) n_3 = n + 1; n_2 = n_3; src = (void *)operator new[](n_3); memcpy(src, src_4, n); if ( src_4 != &v92 && src_4 ) operator delete[](src_4); n_1 = n; } n = n_1 + 1; *((_BYTE *)src + n_1) = v39; if ( v34 == v33 ) break; qword10_5 = (__int64 *)this->qword10; v35 = v34 + 1; v28 = *qword10_5; if ( *((unsigned int *)qword10_5 + 6) + 8 * (qword10_5[2] - *qword10_5) - (unsigned __int64)*((unsigned int *)qword10_5 + 2) <= v34 + 1 ) LABEL_96: std::__throw_out_of_range("vector<bool>::_M_range_check"); ++v34; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_85: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { qword18_4 = this->qword18; v97 |= 0x40u; src_3[36] = qword18_4; } break; case 4: case 5: case 6: qword10_6 = (__int64 *)this->qword10; if ( !qword10_6 ) goto LABEL_21; v17 = *qword10_6; v18 = (qword10_6[1] - *qword10_6) >> 3; if ( (int)v18 <= 0 ) goto LABEL_21; if ( !v18 ) goto LABEL_95; v19 = (unsigned int)(v18 - 1); v20 = 0; v21 = 0; while ( 1 ) { v25 = v94; v69 = v95; v26 = (const std::string *)(v17 + 8 * v21); if ( v94 >= v95 ) { if ( v95 == v96 ) { p__ZN6google8protobuf8internal12kEmptyStringE_2 = (std::string *)&v93; google::protobuf::internal::RepeatedPtrFieldBase::Reserve( (google::protobuf::internal::RepeatedPtrFieldBase *)&v93, v95 + 1); v69 = v95; } v95 = v69 + 1; p__ZN6google8protobuf8internal12kEmptyStringE_3 = (std::string *)google::protobuf::internal::StringTypeHandlerBase::New(p__ZN6google8protobuf8internal12kEmptyStringE_2); v23 = v94; p__ZN6google8protobuf8internal12kEmptyStringE_2 = p__ZN6google8protobuf8internal12kEmptyStringE_3; ++v94; *(_QWORD *)(v93 + 8 * v23) = p__ZN6google8protobuf8internal12kEmptyStringE_3; } else { ++v94; p__ZN6google8protobuf8internal12kEmptyStringE_2 = *(std::string **)(v93 + 8 * v25); } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_2, v26); if ( v20 == v19 ) break; qword10_7 = (__int64 *)this->qword10; v21 = v20 + 1; v17 = *qword10_7; if ( (qword10_7[1] - *qword10_7) >> 3 <= (unsigned __int64)(v20 + 1) ) LABEL_95: std::__throw_out_of_range("vector::_M_range_check"); ++v20; } LOBYTE(v13) = HIBYTE(this->attrib_flags); LABEL_21: v13 = (const google::protobuf::Message *)((unsigned __int8)v13 & 1); if ( (_DWORD)v13 ) { v97 |= 0x80u; p__ZN6google8protobuf8internal12kEmptyStringE_4 = p__ZN6google8protobuf8internal12kEmptyStringE_1; qword18_5 = (const std::string *)this->qword18; if ( p__ZN6google8protobuf8internal12kEmptyStringE_1 == (std::string *)&google::protobuf::internal::kEmptyString ) { p__ZN6google8protobuf8internal12kEmptyStringE_4 = (std::string *)operator new(8u); *(_QWORD *)p__ZN6google8protobuf8internal12kEmptyStringE_4 = (char *)&std::string::_Rep::_S_empty_rep_storage + 24; p__ZN6google8protobuf8internal12kEmptyStringE_1 = p__ZN6google8protobuf8internal12kEmptyStringE_4; } std::string::assign(p__ZN6google8protobuf8internal12kEmptyStringE_4, qword18_5); } break; default: break; } HDDMDevice::writeMessage((HDDMDevice *)stream, (std::ostream *)v72, v13); HDDMXng::BelUsageAttrib::~BelUsageAttrib((HDDMXng::BelUsageAttrib *)v72); } __int64 __fastcall HDDMBelUsageAttrib::print(HDDMBelUsageAttrib *this) { char n3; // al __int64 **qword10_1; // rax __int64 *v3; // r12 __int64 *v4; // rax __int64 v5; // rsi __int64 result; // rax unsigned int **qword10; // rax unsigned int *v8; // r12 unsigned int *v9; // rax __int64 v10; // rsi unsigned int qword18; // r12d __int64 qword10_2; // rax unsigned int n63; // r12d _QWORD *i_1; // rcx int n63_2; // esi _QWORD *i; // r13 __int64 qword10_3; // rax __int64 qword10_4; // rax unsigned int n63_1; // eax unsigned int qword18_low; // r12d double **qword10_5; // rax double *v22; // r12 double *v23; // rax double v24; // xmm0_8 _QWORD *qword18_1; // r12 double v26; // [rsp+8h] [rbp-30h] n3 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n3 != 2 ) { if ( n3 != 3 ) { if ( n3 == 1 ) { std::__ostream_insert<char,std::char_traits<char>>(&std::cout, "int ", 4); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, this->qword8, *(_QWORD *)(this->qword8 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " ( ", 3); qword10 = (unsigned int **)this->qword10; if ( qword10 ) { v8 = *qword10; v9 = qword10[1]; while ( v8 != v9 ) { while ( 1 ) { v10 = *v8++; std::ostream::operator<<(&std::cout, v10); v9 = v8; if ( *(unsigned int **)(this->qword10 + 8LL) == v8 ) break; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, ", ", 2); if ( v8 == *(unsigned int **)(this->qword10 + 8LL) ) goto LABEL_18; } } } LABEL_18: if ( (this->attrib_flags & 0x1000000) != 0 ) { qword18 = this->qword18; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " default=", 9); std::ostream::operator<<(&std::cout, qword18); } } else { std::__ostream_insert<char,std::char_traits<char>>(&std::cout, "string ", 7); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, this->qword8, *(_QWORD *)(this->qword8 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " ( ", 3); qword10_1 = (__int64 **)this->qword10; if ( qword10_1 ) { v3 = *qword10_1; v4 = qword10_1[1]; while ( v3 != v4 ) { while ( 1 ) { v5 = *v3++; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, v5, *(_QWORD *)(v5 - 24)); v4 = v3; if ( *(__int64 **)(this->qword10 + 8LL) == v3 ) break; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, ", ", 2); if ( v3 == *(__int64 **)(this->qword10 + 8LL) ) goto LABEL_9; } } } LABEL_9: if ( (this->attrib_flags & 0x1000000) != 0 ) { qword18_1 = (_QWORD *)this->qword18; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " default=", 9); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, *qword18_1, *(_QWORD *)(*qword18_1 - 24LL)); } } goto LABEL_11; } std::__ostream_insert<char,std::char_traits<char>>(&std::cout, "bool ", 5); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, this->qword8, *(_QWORD *)(this->qword8 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " ( ", 3); qword10_2 = this->qword10; if ( !qword10_2 ) { LABEL_28: if ( (this->attrib_flags & 0x1000000) != 0 ) { qword18_low = LOBYTE(this->qword18); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " default=", 9); std::ostream::_M_insert<bool>(&std::cout, qword18_low); } goto LABEL_11; } n63 = *(_DWORD *)(qword10_2 + 8); i_1 = *(_QWORD **)(qword10_2 + 16); n63_2 = *(_DWORD *)(qword10_2 + 24); for ( i = *(_QWORD **)qword10_2; ; ++i ) { while ( 1 ) { if ( i_1 == i && n63 == n63_2 ) goto LABEL_28; std::ostream::_M_insert<bool>(&std::cout, ((1LL << n63) & *i) != 0); qword10_3 = this->qword10; i_1 = &i[(n63 + 1LL) >> 6]; if ( i_1 == *(_QWORD **)(qword10_3 + 16) ) { n63_2 = ((_BYTE)n63 + 1) & 0x3F; if ( n63_2 == *(_DWORD *)(qword10_3 + 24) ) break; } std::__ostream_insert<char,std::char_traits<char>>(&std::cout, ", ", 2); qword10_4 = this->qword10; i_1 = *(_QWORD **)(qword10_4 + 16); n63_2 = *(_DWORD *)(qword10_4 + 24); n63_1 = n63 + 1; if ( n63 == 63 ) goto LABEL_32; LABEL_25: n63 = n63_1; } n63_1 = n63 + 1; if ( n63 != 63 ) goto LABEL_25; LABEL_32: n63 = 0; } } std::__ostream_insert<char,std::char_traits<char>>(&std::cout, "double ", 7); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, this->qword8, *(_QWORD *)(this->qword8 - 24LL)); std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " ( ", 3); qword10_5 = (double **)this->qword10; if ( qword10_5 ) { v22 = *qword10_5; v23 = qword10_5[1]; while ( v22 != v23 ) { while ( 1 ) { v24 = *v22++; std::ostream::_M_insert<double>(&std::cout, v24); v23 = v22; if ( *(double **)(this->qword10 + 8LL) == v22 ) break; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, ", ", 2); if ( v22 == *(double **)(this->qword10 + 8LL) ) goto LABEL_38; } } } LABEL_38: if ( (this->attrib_flags & 0x1000000) != 0 ) { v26 = *(double *)&this->qword18; std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " default=", 9); std::ostream::_M_insert<double>(&std::cout, v26); } LABEL_11: result = std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " ) ", 3); if ( (this->attrib_flags & 0x2000000) != 0 ) return std::__ostream_insert<char,std::char_traits<char>>(&std::cout, " (HIDDEN=true)", 14); return result; } void __fastcall HDDMBelUsageAttrib::~HDDMBelUsageAttrib(HDDMBelUsageAttrib *this) { char n2; // al __int64 **qword10_1; // r14 __int64 *v4; // r13 __int64 *v5; // rbp void *p__ZNSs4_Rep20_S_empty_rep_storageE; // rdi __int64 *v7; // rdi _QWORD *qword18; // rbp void **qword10; // rbp __int64 qword8; // rax __int64 v11; // rdi int v12; // eax __int64 v13; // rax void *p__ZNSs4_Rep20_S_empty_rep_storageE_1; // rdi int v15; // edx int v16; // edx _BYTE v17[57]; // [rsp+Fh] [rbp-39h] BYREF n2 = (HIBYTE(this->attrib_flags) >> 3) & 7; if ( n2 == 2 || n2 == 3 || n2 == 1 ) { qword10 = (void **)this->qword10; if ( qword10 ) { if ( *qword10 ) operator delete(*qword10); operator delete(qword10); } this->qword10 = 0; } else { qword10_1 = (__int64 **)this->qword10; if ( qword10_1 ) { v4 = qword10_1[1]; v5 = *qword10_1; if ( v4 == *qword10_1 ) { v7 = qword10_1[1]; } else { if ( &_pthread_key_create ) { do { p__ZNSs4_Rep20_S_empty_rep_storageE = (void *)(*v5 - 24); if ( p__ZNSs4_Rep20_S_empty_rep_storageE != &std::string::_Rep::_S_empty_rep_storage && _InterlockedExchangeAdd((volatile signed __int32 *)(*v5 - 8), 0xFFFFFFFF) <= 0 ) { std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE, v17); } ++v5; } while ( v4 != v5 ); } else { do { v13 = *v5; p__ZNSs4_Rep20_S_empty_rep_storageE_1 = (void *)(*v5 - 24); if ( p__ZNSs4_Rep20_S_empty_rep_storageE_1 != &std::string::_Rep::_S_empty_rep_storage ) { v16 = *(_DWORD *)(v13 - 8); *(_DWORD *)(v13 - 8) = v16 - 1; if ( v16 <= 0 ) std::string::_Rep::_M_destroy(p__ZNSs4_Rep20_S_empty_rep_storageE_1, v17); } ++v5; } while ( v4 != v5 ); } v7 = *qword10_1; } if ( v7 ) operator delete(v7); operator delete(qword10_1); this->qword10 = 0; } qword18 = (_QWORD *)this->qword18; if ( qword18 ) { std::string::_Rep::_M_dispose(*qword18 - 24LL, v17); operator delete(qword18); this->qword18 = 0; } } std::_Rb_tree<HSTString,std::pair<HSTString const,unsigned short>,std::_Select1st<std::pair<HSTString const,unsigned short>>,std::less<HSTString>,std::allocator<std::pair<HSTString const,unsigned short>>>::_M_erase( this->p_qword10, this->qword30); qword8 = this->qword8; v11 = qword8 - 24; if ( (_UNKNOWN *)(qword8 - 24) != &std::string::_Rep::_S_empty_rep_storage ) { if ( &_pthread_key_create ) { v12 = _InterlockedExchangeAdd((volatile signed __int32 *)(qword8 - 8), 0xFFFFFFFF); } else { v15 = *(_DWORD *)(qword8 - 8); *(_DWORD *)(qword8 - 8) = v15 - 1; v12 = v15; } if ( v12 <= 0 ) std::string::_Rep::_M_destroy(v11, v17); } }
10-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值