// File: /workspace/github_cpp_makefile_star2_O3/acliusBackHome[P]kamaya/dist/ParseType.cpp
// Function: ParseType::get_struct(std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long>>> const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long>>> const&)
ParseType ParseType::get_struct(const vector<pair<string, size_t> > &otherTypes,
                                const vector<pair<string, size_t> > &self_ptr) {
    if(id2type.empty()) {
        init();
    }
    size_t new_type_id = id2type.size();
    // 给新类型预分配位置
    // 这有个"特性": 如果重复调用此函数试图生成一模一样的结构体会被看成两个
    id2type.emplace_back(T_UNKNOWN);
    ParseType &res = id2type[new_type_id];
    res.base_type = T_UNKNOWN;
    res.type_id = (size_t) -1;
    res.lower_type = 0;
    res.fields = new map<string, size_t>();
    res.type_size = res.pointer_level = res.array_size = 0;
    auto &res_fields = *res.fields;
    for (const auto &field: otherTypes) {
        if (res_fields.find(field.first) == res_fields.end()) {
            (*res.fields)[field.first] = field.second;
            res.type_size += get_type(field.second).get_size();
        } else {
            return ParseType();
        }
    }
    for (const auto &self_ptr_field: self_ptr) {
        if (res_fields.find(self_ptr_field.first) == res_fields.end()) {
            ParseType ptr(T_UNKNOWN, new_type_id, nullptr, sizeof(void *), self_ptr_field.second, 0);
            res.type_size += ptr.type_size;
            (*res.fields)[self_ptr_field.first] = get_type_id(ptr);
        } else {
            return ParseType();
        }
    }
    type2id[res] = res.type_id = new_type_id;
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, -0x48(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
movq 0x34606(%rip), %rax     # 0x5c2f8
movq 0x34607(%rip), %rbx     # 0x5c300
cmpq %rbx, %rax
jne 0x27d11
callq 0x27f46
movq 0x345f6(%rip), %rbx     # 0x5c300
movq 0x345e7(%rip), %rax     # 0x5c2f8
subq %rax, %rbx
xorl %r12d, %r12d
leaq -0x90(%rbp), %rsi
movl %r12d, (%rsi)
leaq 0x345d0(%rip), %rdi     # 0x5c2f8
callq 0x28cac
movq 0x345c4(%rip), %r13     # 0x5c2f8
leaq (%rbx,%r13), %r14
movl %r12d, (%r13,%rbx)
movq $-0x1, 0x18(%r13,%rbx)
movq %r12, 0x8(%r13,%rbx)
movl $0x30, %edi
callq 0x42e0
movq %rax, %r15
addq $0x8, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %rax, 0x18(%r15)
movq %rax, -0x50(%rbp)
movq %rax, 0x20(%r15)
movq %r12, 0x28(%r15)
movq %r15, 0x10(%r13,%rbx)
movups %xmm0, 0x20(%r13,%rbx)
movq %rbx, -0x40(%rbp)
movq %r13, -0x58(%rbp)
movq %r12, 0x30(%r13,%rbx)
movq -0x30(%rbp), %rax
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x27de1
movq %r15, %rdi
movq %r12, %rsi
callq 0x19ea6
cmpq -0x50(%rbp), %rax
jne 0x27efc
movq 0x20(%r12), %rbx
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x18fe4
movq %rbx, (%rax)
movq 0x20(%r12), %rdi
callq 0x2796c
movq 0x20(%rax), %rax
addq %rax, 0x20(%r14)
addq $0x28, %r12
jmp 0x27d9b
movq -0x40(%rbp), %rcx
movq %rcx, %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rdx
movq %rdx, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %r13
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq %rax, %r13
je 0x27ebc
movq -0x58(%rbp), %rax
addq %rcx, %rax
addq $0x20, %rax
movq %rax, -0x40(%rbp)
xorl %r12d, %r12d
movq %r15, %rdi
movq %r13, %rsi
callq 0x19ea6
cmpq -0x50(%rbp), %rax
jne 0x27efc
movq 0x20(%r13), %rax
movq %r12, -0x90(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq %r12, -0x80(%rbp)
movq $0x8, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movq %r12, -0x60(%rbp)
movq $-0x1, -0x78(%rbp)
movq -0x40(%rbp), %rax
addq $0x8, (%rax)
leaq -0x90(%rbp), %rdi
callq 0x27870
movq %rax, %rbx
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x18fe4
movq %rbx, (%rax)
movq -0x80(%rbp), %rbx
testq %rbx, %rbx
je 0x27ea6
movq %rbx, %rdi
callq 0x13f28
movq %rbx, %rdi
callq 0x42b0
addq $0x28, %r13
cmpq -0x48(%rbp), %r13
jne 0x27e28
movq -0x30(%rbp), %rbx
movq %rbx, 0x18(%r14)
leaq 0x343fd(%rip), %rdi     # 0x5c2c8
movq %r14, %rsi
callq 0x28cec
movq %rbx, (%rax)
movq -0x38(%rbp), %rbx
movl $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26ea0
jmp 0x27f1d
movq -0x38(%rbp), %rbx
movl $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x28(%rbx)
movq $-0x1, 0x18(%rbx)
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x27ca8
movq %rbx, %rdi
callq 0x4560