// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseType.cpp
// Function: ParseType::operator<(ParseType const&) const
bool ParseType::operator<(const ParseType &other) const {
    if (type_size < other.type_size) {
        return true;
    } else if (type_size > other.type_size) {
        return false;
    }
    if (base_type < other.base_type) {
        return true;
    } else if (base_type > other.base_type) {
        return false;
    }
    if (specifier < other.specifier) {
        return true;
    } else if (specifier > other.specifier) {
        return false;
    }
    if (lower_type < other.lower_type) {
        return true;
    } else if (lower_type > other.lower_type) {
        return false;
    }
    if (pointer_level < other.pointer_level) {
        return true;
    } else if (pointer_level > other.pointer_level) {
        return false;
    }
    if (array_size < other.array_size) {
        return true;
    } else if (array_size > other.array_size) {
        return false;
    }
    if (!fields && other.fields) {
        return true;
    } else if (fields && !other.fields) {
        return false;
    } else if (fields && other.fields) {
        if (fields->size() < other.fields->size()) {
            return true;
        } else if (fields->size() > other.fields->size()) {
            return false;
        }
        set<string> all_fields;
        // 字典比较遵循以下原则: 遍历字典: 对两者都有的键来说, 没有键的一方小
        // 同样键中, 值小的一方小
        for (const auto &each : *fields) {
            if (all_fields.find(each.first) == all_fields.end()) {
                all_fields.insert(each.first);
            }
        }
        for (const auto &each : *other.fields) {
            if (all_fields.find(each.first) == all_fields.end()) {
                all_fields.insert(each.first);
            }
        }
        for (const auto &each: all_fields) {
            auto iter_this = fields->find(each), iter_other = other.fields->find(each);
            if (iter_this == fields->end() && iter_other != other.fields->end()) {
                return true;
            } else if (iter_this != fields->end() && iter_other == other.fields->end()) {
                return false;
            } else {
                // 到这一步一定都存在该键值
                if (iter_this->second < iter_other->second) {
                    return true;
                } else if (iter_this->second > iter_other->second) {
                    return false;
                }
            }
        }
    }
    // 到了这一步说明相等
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x20(%rdi), %rax
movq 0x20(%rsi), %rcx
movb $0x1, %r15b
cmpq %rcx, %rax
jb 0x22180
jbe 0x22172
xorl %r15d, %r15d
jmp 0x22180
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
movl (%rsi), %ecx
cmpl %ecx, %eax
jge 0x22192
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jg 0x2216d
movl 0x4(%r14), %eax
movl 0x4(%rbx), %ecx
cmpl %ecx, %eax
jl 0x22180
jg 0x2216d
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jb 0x22180
ja 0x2216d
movq 0x28(%r14), %rax
movq 0x28(%rbx), %rcx
cmpq %rcx, %rax
jb 0x22180
ja 0x2216d
movq 0x30(%r14), %rax
movq 0x30(%rbx), %rcx
cmpq %rcx, %rax
jb 0x22180
ja 0x2216d
movq 0x10(%r14), %r12
testq %r12, %r12
setne %cl
movq 0x10(%rbx), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x22180
testq %rax, %rax
sete %cl
testq %r12, %r12
setne %dl
testb %cl, %dl
jne 0x2216d
testq %rax, %rax
sete %cl
testq %r12, %r12
sete %dl
orb %cl, %dl
jne 0x2216d
movq 0x28(%r12), %rcx
movq 0x28(%rax), %rax
cmpq %rax, %rcx
jb 0x22180
ja 0x2216d
leaq -0x50(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x18(%r12), %r15
addq $0x8, %r12
cmpq %r12, %r15
je 0x22282
leaq 0x20(%r15), %r13
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x23940
leaq -0x50(%rbp), %rcx
cmpq %rcx, %rax
jne 0x22275
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x239ca
movq %r15, %rdi
callq 0x4210
movq %rax, %r15
jmp 0x2224b
movq 0x10(%rbx), %r12
movq 0x18(%r12), %r15
addq $0x8, %r12
cmpq %r12, %r15
je 0x222c6
leaq 0x20(%r15), %r13
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x23940
leaq -0x50(%rbp), %rcx
cmpq %rcx, %rax
jne 0x222b9
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x239ca
movq %r15, %rdi
callq 0x4210
movq %rax, %r15
jmp 0x2228f
movq -0x40(%rbp), %r12
leaq -0x50(%rbp), %rax
cmpq %rax, %r12
je 0x22345
leaq 0x20(%r12), %r15
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x17536
movq %rax, %r13
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x17536
movq 0x10(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %r13
sete %sil
movq 0x10(%rbx), %rdx
addq $0x8, %rdx
cmpq %rdx, %rax
setne %dil
movb $0x1, %r15b
testb %dil, %sil
jne 0x22348
cmpq %rcx, %r13
setne %cl
cmpq %rdx, %rax
sete %dl
testb %dl, %cl
jne 0x22345
movq 0x40(%r13), %rcx
movq 0x40(%rax), %rax
cmpq %rax, %rcx
jb 0x22348
ja 0x22345
movq %r12, %rdi
callq 0x42f0
movq %rax, %r12
jmp 0x222ca
xorl %r15d, %r15d
leaq -0x58(%rbp), %rdi
callq 0x22f18
leaq -0x50(%rbp), %rax
cmpq %rax, %r12
jne 0x22180
jmp 0x2216d
jmp 0x2236d
jmp 0x2236d
jmp 0x2236d
jmp 0x2236d
jmp 0x2236d
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x22f18
movq %rbx, %rdi
callq 0x4500
nop