// File: /workspace/github_cpp_makefile_star2_O3/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 0x2827a
jbe 0x2826c
xorl %r15d, %r15d
jmp 0x2827a
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
movl (%rsi), %ecx
cmpl %ecx, %eax
jge 0x2828c
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jg 0x28267
movl 0x4(%r14), %eax
movl 0x4(%rbx), %ecx
cmpl %ecx, %eax
jl 0x2827a
jg 0x28267
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jb 0x2827a
ja 0x28267
movq 0x28(%r14), %rax
movq 0x28(%rbx), %rcx
cmpq %rcx, %rax
jb 0x2827a
ja 0x28267
movq 0x30(%r14), %rax
movq 0x30(%rbx), %rcx
cmpq %rcx, %rax
jb 0x2827a
ja 0x28267
movq 0x10(%r14), %r12
testq %r12, %r12
setne %al
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2827a
testq %rsi, %rsi
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x28267
movq 0x28(%r12), %rax
movq 0x28(%rsi), %rcx
cmpq %rcx, %rax
jb 0x2827a
ja 0x28267
movq %rsi, %rdx
leaq -0x50(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x18(%r12), %r15
addq $0x8, %r12
cmpq %r12, %r15
je 0x28375
leaq 0x20(%r15), %r13
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x29b0e
leaq -0x50(%rbp), %rcx
cmpq %rcx, %rax
jne 0x28361
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x29bac
movq %r15, %rdi
callq 0x4230
movq %rax, %r15
cmpq %r12, %rax
jne 0x2833c
movq 0x10(%rbx), %rdx
movq %rdx, %r12
movq 0x18(%rdx), %r15
addq $0x8, %r12
cmpq %r12, %r15
je 0x283ba
leaq 0x20(%r15), %r13
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x29b0e
leaq -0x50(%rbp), %rcx
cmpq %rcx, %rax
jne 0x283aa
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x29bac
movq %r15, %rdi
callq 0x4230
movq %rax, %r15
cmpq %r12, %rax
jne 0x28385
movq -0x40(%rbp), %rcx
leaq -0x50(%rbp), %rax
cmpq %rax, %rcx
je 0x2844c
movq 0x10(%r14), %r13
movq %rcx, -0x60(%rbp)
leaq 0x20(%rcx), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x19ea6
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x19ea6
movq 0x10(%r14), %r13
leaq 0x8(%r13), %rcx
cmpq %rcx, %r12
sete %sil
movq 0x10(%rbx), %rdx
addq $0x8, %rdx
cmpq %rdx, %rax
setne %dil
movb $0x1, %r15b
testb %dil, %sil
jne 0x2845d
cmpq %rcx, %r12
setne %cl
cmpq %rdx, %rax
sete %dl
testb %dl, %cl
jne 0x2845a
movq 0x40(%r12), %rcx
movq 0x40(%rax), %rax
cmpq %rax, %rcx
jb 0x2845d
ja 0x2845a
movq -0x60(%rbp), %rdi
callq 0x4350
movq %rax, %rcx
leaq -0x50(%rbp), %rax
cmpq %rax, %rcx
jne 0x283cf
leaq -0x58(%rbp), %rdi
callq 0x29186
jmp 0x28267
xorl %r15d, %r15d
leaq -0x58(%rbp), %rdi
callq 0x29186
jmp 0x2827a
jmp 0x28475
jmp 0x28475
jmp 0x28475
jmp 0x28475
jmp 0x28475
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x29186
movq %rbx, %rdi
callq 0x4560
nop