// File: /workspace/github_cpp_makefile_star2_O3/acliusBackHome[P]kamaya/dist/ParseType.cpp
// Function: ParseType::convert(ExpressionType, ParseType const&, ParseType const&)
size_t ParseType::convert(ExpressionType op_type, const ParseType &type1, const ParseType &type2) {
    size_t type1_id = type1.get_id(), type2_id = type2.get_id();
    auto iter = op_able.find(OpAble(op_type, type1_id, type2_id));
    if (iter != op_able.end()) {
        // 找到记录, 返回
        if (iter->second != (size_t) -1) {
            // 有效记录
            return iter->second;
        }
        // 已经搜索过且被标记为不可转化(-1)抛出异常
    } else {
        // 进行DFS
        op_trying.clear();
        OpAble op_try(op_type, type1_id, type2_id);
        size_t res = dfs_convert(op_try);
        // 插入记录 缓存
        op_able[op_try] = res;
        if (res != (size_t) -1) {
            return res;
        }
    }
    string info = "ParseType::convert(ExpressionType op_type, const ParseType &type1, const ParseType &type2)";
    info += " type1=" + type1.get_info();
    info += " type2=" + type2.get_info();
    throw ParseException(EX_TYPE_CAN_NOT_CONVERT, info);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
movq 0x18(%rsi), %r12
cmpq $-0x1, %r12
jne 0x28653
movq %r14, %rdi
callq 0x27870
movq %rax, %r12
movq %rax, 0x18(%r14)
movq 0x18(%rbx), %r13
cmpq $-0x1, %r13
jne 0x2866c
movq %rbx, %rdi
callq 0x27870
movq %rax, %r13
movq %rax, 0x18(%rbx)
leaq -0x90(%rbp), %rsi
movq %r13, (%rsi)
movq %r12, 0x8(%rsi)
movl %r15d, 0x10(%rsi)
leaq 0x33cd3(%rip), %rdi     # 0x5c358
callq 0x29f4c
leaq 0x33ccf(%rip), %rcx     # 0x5c360
cmpq %rcx, %rax
je 0x2869c
movq 0x38(%rax), %r15
jmp 0x286df
leaq 0x33c85(%rip), %rdi     # 0x5c328
callq 0x29ffc
movq %rbx, -0x50(%rbp)
leaq -0x90(%rbp), %rbx
movq %r13, (%rbx)
movq %r12, 0x8(%rbx)
movl %r15d, 0x10(%rbx)
movq %rbx, %rdi
callq 0x28876
movq %rax, %r15
leaq 0x33c88(%rip), %rdi     # 0x5c358
movq %rbx, %rsi
movq -0x50(%rbp), %rbx
callq 0x28dd2
movq %r15, (%rax)
cmpq $-0x1, %r15
je 0x286f7
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1d8f7(%rip), %rsi     # 0x45ffd
leaq 0x1d94a(%rip), %rdx     # 0x46057
leaq -0x90(%rbp), %rdi
callq 0xf868
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq 0x273f2
leaq 0x1d92c(%rip), %rsi     # 0x46058
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xe495
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x4110
leaq -0x38(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x28760
callq 0x42b0
leaq -0x60(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x28772
callq 0x42b0
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x273f2
leaq 0x1d8db(%rip), %rsi     # 0x46060
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xe495
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x4110
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x287b4
callq 0x42b0
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x287c2
callq 0x42b0
movl $0x28, %edi
callq 0x4190
movq %rax, %r14
leaq -0x90(%rbp), %rdx
movq %rax, %rdi
movl $0xf, %esi
callq 0x333ee
leaq 0x32586(%rip), %rsi     # 0x5ad70
leaq -0x1a251(%rip), %rdx    # 0xe5a0
movq %r14, %rdi
callq 0x4540
jmp 0x28859
movq %rax, %rbx
movq %r14, %rdi
callq 0x4250
jmp 0x2885c
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x2881e
callq 0x42b0
jmp 0x2881e
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
jne 0x28852
jmp 0x2885c
jmp 0x28859
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28845
callq 0x42b0
jmp 0x28845
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2885c
callq 0x42b0
jmp 0x2885c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x2886d
callq 0x42b0
movq %rbx, %rdi
callq 0x4560
nop