// File: /workspace/github_cpp_makefile_star2_O1/acliusBackHome[P]kamaya/dist/ParseType.cpp
// Function: ParseType::dfs_convert(std::tuple<ExpressionType, unsigned long, unsigned long> const&)
size_t ParseType::dfs_convert(const OpAble &op_try) {
    const auto record = op_able.find(op_try);
    if (record != op_able.end()) {
        return record->second;
    }
    ExpressionType op_type = get<0>(op_try);
    size_t type1_id = get<1>(op_try), type2_id = get<2>(op_try);
    if (type1_id == type2_id) {
        // 完全一致
        op_able[op_try] = type1_id;
        return type1_id;
    }
    const ParseType &type1 = get_type(type1_id), &type2 = get_type(type2_id);
    if (type1.base_type != T_UNKNOWN && type2.base_type != T_UNKNOWN) {
        // 发现是基础类型的派生
        if (type1.base_type > type2.base_type) {
            op_able[op_try] = type1_id;
            return type1_id;
        }
        if (type1.base_type < type2.base_type) {
            op_able[op_try] = type2_id;
            return type2_id;
        }
        // base_type一致, 比较声明符号
        if (type1.specifier > type2.specifier) {
            op_able[op_try] = type1_id;
            return type1_id;
        }
        if (type1.specifier < type2.specifier) {
            op_able[op_try] = type2_id;
            return type2_id;
        }
        //完全一致
        op_able[op_try] = type1_id;
        return type1_id;
    }
    // 向下一层搜索
    op_trying.insert(op_try);
    // 拿到所有type1和type2能够无条件转化的类型
    vector<size_t> type1_to, type2_to;
    for (const auto &each : op_able) {
        // 遍历目前记录表能够拿到的所有记录
        // 这个可以用多层map进行优化, 但是...现在还没必要...
        const auto &op = each.first;
        if (get<0>(each.first) == E_UNDEFINED) {
            if (get<1>(each.first) == type1_id) {
                type1_to.emplace_back(each.second);
            } else if (get<1>(each.first) == type2_id) {
                type2_to.emplace_back(each.second);
            }
        }
    }
    for (size_t type1_convert_id : type1_to) {
        for (size_t type2_convert_id : type2_to) {
            OpAble op_try_next(op_type, type1_convert_id, type2_convert_id);
            if (op_trying.find(op_try_next) != op_trying.end()) {
                //这个已经有在之前搜索了, 跳过
                // 防止DFS环
                continue;
            }
            size_t try_res = dfs_convert(op_try_next);// op_try_next已经在下一层标记了
            if (try_res != (size_t) -1) {
                // 结果有效
                op_able[op_try] = try_res;
                return try_res;
            }
            // 无效继续搜索
        }
    }
    // 搜索完毕, type1和type2怎么转化都无法得到表达式op_type的返回值
    op_able[op_try] = (size_t) -1;
    return (size_t) -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r12
leaq 0x34312(%rip), %rdi     # 0x5d358
movq %r12, %rsi
callq 0x2a7b0
leaq 0x3430b(%rip), %rbx     # 0x5d360
cmpq %rbx, %rax
je 0x29063
movq 0x38(%rax), %r14
jmp 0x292d3
movq (%r12), %r15
movq 0x8(%r12), %r14
cmpq %r15, %r14
jne 0x29088
leaq 0x342e0(%rip), %rdi     # 0x5d358
movq %r12, %rsi
callq 0x295ea
movq %r14, (%rax)
jmp 0x292d3
movq %r12, -0x38(%rbp)
movl 0x10(%r12), %eax
movl %eax, -0x3c(%rbp)
movq %r14, %r13
movq %r14, %rdi
callq 0x28004
movq %rax, %r12
movq %r15, %rdi
callq 0x28004
movl (%r12), %ecx
testl %ecx, %ecx
je 0x290db
movl (%rax), %edx
testl %edx, %edx
je 0x290db
cmpl %edx, %ecx
jle 0x292bb
leaq 0x34291(%rip), %rdi     # 0x5d358
movq -0x38(%rbp), %rsi
callq 0x295ea
movq %r13, %r14
movq %r13, (%rax)
jmp 0x292d3
leaq 0x34246(%rip), %rdi     # 0x5d328
movq -0x38(%rbp), %rsi
callq 0x2aac4
xorl %eax, %eax
movq %rax, -0x70(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq %rax, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movq 0x34269(%rip), %r12     # 0x5d370
cmpq %rbx, %r12
je 0x29178
leaq -0x80(%rbp), %r14
cmpl $0x0, 0x30(%r12)
jne 0x29168
movq 0x28(%r12), %rax
cmpq %r13, %rax
jne 0x29147
leaq 0x38(%r12), %rdx
movq -0x78(%rbp), %rsi
movq %r14, %rdi
leaq -0x78(%rbp), %rax
cmpq -0x70(%rbp), %rsi
je 0x29163
movq (%rdx), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, (%rax)
jmp 0x29168
cmpq %r15, %rax
jne 0x29168
leaq 0x38(%r12), %rdx
movq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rsi
jne 0x29138
callq 0x19b5e
movq %r12, %rdi
callq 0x4230
movq %rax, %r12
cmpq %rbx, %rax
jne 0x29110
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq %rax, %rcx
sete -0x29(%rbp)
je 0x29272
leaq -0xb0(%rbp), %r12
movq -0x60(%rbp), %r15
movq -0x58(%rbp), %r13
movl $0x6, %eax
cmpq %r13, %r15
je 0x29252
movq %rcx, -0x88(%rbp)
movq (%rcx), %r14
movq (%r15), %rax
movq %rax, -0xb0(%rbp)
movq %r14, -0xa8(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0xa0(%rbp)
leaq 0x3414c(%rip), %rdi     # 0x5d328
movq %r12, %rsi
callq 0x2ac70
movl $0x7, %ecx
leaq 0x34140(%rip), %rdx     # 0x5d330
cmpq %rdx, %rax
jne 0x29229
movq %r12, %rdi
callq 0x29028
movq %rax, %rbx
cmpq $-0x1, %rax
je 0x29227
leaq 0x3414b(%rip), %rdi     # 0x5d358
movq -0x38(%rbp), %rsi
callq 0x295ea
movq %rbx, (%rax)
movl $0x1, %ecx
movq %rbx, -0x98(%rbp)
jmp 0x29229
xorl %ecx, %ecx
cmpl $0x7, %ecx
je 0x29232
testl %ecx, %ecx
jne 0x29249
addq $0x8, %r15
cmpq %r13, %r15
jne 0x291bb
movq -0x88(%rbp), %rcx
movl $0x6, %eax
jmp 0x29252
movl %ecx, %eax
movq -0x88(%rbp), %rcx
cmpl $0x6, %eax
je 0x2925b
testl %eax, %eax
jne 0x29272
addq $0x8, %rcx
cmpq -0x90(%rbp), %rcx
sete -0x29(%rbp)
jne 0x2919b
jmp 0x29272
testb $0x1, -0x29(%rbp)
movq -0x98(%rbp), %r14
je 0x2929d
leaq 0x340d2(%rip), %rdi     # 0x5d358
movq -0x38(%rbp), %rsi
callq 0x295ea
movq $-0x1, (%rax)
movq $-0x1, %r14
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x292ab
callq 0x42b0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x292d3
callq 0x42b0
jmp 0x292d3
jge 0x292e8
leaq 0x34094(%rip), %rdi     # 0x5d358
movq -0x38(%rbp), %rsi
callq 0x295ea
movq %r15, (%rax)
movq %r15, %r14
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%r12), %ebx
movl 0x4(%rax), %r14d
cmpl %r14d, %ebx
jg 0x290c0
leaq 0x34057(%rip), %rdi     # 0x5d358
movq -0x38(%rbp), %rsi
callq 0x295ea
cmpl %r14d, %ebx
jl 0x292cd
movq %r13, %r14
jmp 0x29080
jmp 0x2931d
jmp 0x2931d
jmp 0x2931d
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2932e
callq 0x42b0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x2933c
callq 0x42b0
movq %rbx, %rdi
callq 0x4560