// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %rdi
callq 0x212de
movq %rax, %r12
movq %rbx, %rdi
callq 0x212de
movq %rax, %r13
leaq -0x90(%rbp), %rsi
movq %rax, (%rsi)
movq %r12, 0x8(%rsi)
movl %r15d, 0x10(%rsi)
leaq 0x31e1d(%rip), %rdi     # 0x54328
callq 0x23d46
leaq 0x31e19(%rip), %rcx     # 0x54330
cmpq %rcx, %rax
je 0x22522
movq 0x38(%rax), %r15
jmp 0x22565
leaq 0x31dcf(%rip), %rdi     # 0x542f8
callq 0x23dd0
movq %rbx, -0x50(%rbp)
leaq -0x90(%rbp), %rbx
movq %r13, (%rbx)
movq %r12, 0x8(%rbx)
movl %r15d, 0x10(%rbx)
movq %rbx, %rdi
callq 0x22694
movq %rax, %r15
leaq 0x31dd2(%rip), %rdi     # 0x54328
movq %rbx, %rsi
movq -0x50(%rbp), %rbx
callq 0x22aec
movq %r15, (%rax)
cmpq $-0x1, %r15
je 0x2257d
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18a11(%rip), %rsi     # 0x3af95
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x4130
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq 0x215a0
leaq 0x18a49(%rip), %rsi     # 0x3aff0
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xc837
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4580
leaq -0x48(%rbp), %rdi
callq 0x4598
leaq -0x70(%rbp), %rdi
callq 0x4598
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x215a0
leaq 0x18a0f(%rip), %rsi     # 0x3aff8
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xc837
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4580
leaq -0x48(%rbp), %rdi
callq 0x4598
leaq -0x70(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0xf
popq %rsi
leaq -0x90(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x30734(%rip), %rsi     # 0x52d70
leaq -0x15d9b(%rip), %rdx    # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x2267c
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
jmp 0x2267f
jmp 0x22660
jmp 0x2266e
jmp 0x2267c
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x4598
jmp 0x22671
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x4598
jmp 0x2267f
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x4598
movq %rbx, %rdi
callq 0x4500
nop