// File: /workspace/github_cpp_makefile_star2_O1/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 0x28e05
movq %r14, %rdi
callq 0x27f08
movq %rax, %r12
movq %rax, 0x18(%r14)
movq 0x18(%rbx), %r13
cmpq $-0x1, %r13
jne 0x28e1e
movq %rbx, %rdi
callq 0x27f08
movq %rax, %r13
movq %rax, 0x18(%rbx)
leaq -0x90(%rbp), %rsi
movq %r13, (%rsi)
movq %r12, 0x8(%rsi)
movl %r15d, 0x10(%rsi)
leaq 0x34521(%rip), %rdi     # 0x5d358
callq 0x2a7b0
leaq 0x3451d(%rip), %rcx     # 0x5d360
cmpq %rcx, %rax
je 0x28e4e
movq 0x38(%rax), %r15
jmp 0x28e91
leaq 0x344d3(%rip), %rdi     # 0x5d328
callq 0x2a860
movq %rbx, -0x50(%rbp)
leaq -0x90(%rbp), %rbx
movq %r13, (%rbx)
movq %r12, 0x8(%rbx)
movl %r15d, 0x10(%rbx)
movq %rbx, %rdi
callq 0x29028
movq %rax, %r15
leaq 0x344d6(%rip), %rdi     # 0x5d358
movq %rbx, %rsi
movq -0x50(%rbp), %rbx
callq 0x295ea
movq %r15, (%rax)
cmpq $-0x1, %r15
je 0x28ea9
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 0x1e145(%rip), %rsi     # 0x46ffd
leaq 0x1e198(%rip), %rdx     # 0x47057
leaq -0x90(%rbp), %rdi
callq 0xf65c
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq 0x27a86
leaq 0x1e17a(%rip), %rsi     # 0x47058
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xe2af
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 0x28f12
callq 0x42b0
leaq -0x60(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x28f24
callq 0x42b0
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x27a86
leaq 0x1e129(%rip), %rsi     # 0x47060
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xe2af
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x4110
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x28f66
callq 0x42b0
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x28f74
callq 0x42b0
movl $0x28, %edi
callq 0x4190
movq %rax, %r14
leaq -0x90(%rbp), %rdx
movq %rax, %rdi
movl $0xf, %esi
callq 0x33d12
leaq 0x32dd4(%rip), %rsi     # 0x5bd70
leaq -0x1abe9(%rip), %rdx    # 0xe3ba
movq %r14, %rdi
callq 0x4540
jmp 0x2900b
movq %rax, %rbx
movq %r14, %rdi
callq 0x4250
jmp 0x2900e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x28fd0
callq 0x42b0
jmp 0x28fd0
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
jne 0x29004
jmp 0x2900e
jmp 0x2900b
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28ff7
callq 0x42b0
jmp 0x28ff7
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2900e
callq 0x42b0
jmp 0x2900e
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x2901f
callq 0x42b0
movq %rbx, %rdi
callq 0x4560
nop