// File: 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
subq $0x150, %rsp            # imm = 0x150
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x56260
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56260
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0xc(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x59c00
leaq 0x6ec6c(%rip), %rdi     # 0xc73a8
leaq -0x50(%rbp), %rsi
callq 0x59bd0
movq %rax, -0x38(%rbp)
leaq 0x6ec58(%rip), %rdi     # 0xc73a8
callq 0x59c70
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x59c40
testb $0x1, %al
jne 0x5876c
jmp 0x58794
leaq -0x38(%rbp), %rdi
callq 0x59ca0
cmpq $-0x1, 0x18(%rax)
je 0x58792
leaq -0x38(%rbp), %rdi
callq 0x59ca0
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x58a1d
jmp 0x587fd
leaq 0x6ebdd(%rip), %rdi     # 0xc7378
callq 0x59cc0
leaq -0x70(%rbp), %rdi
leaq -0xc(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x59c00
leaq -0x70(%rbp), %rdi
callq 0x58a40
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq 0x6ebd4(%rip), %rdi     # 0xc73a8
leaq -0x70(%rbp), %rsi
callq 0x59ce0
movq -0x138(%rbp), %rcx
movq %rcx, (%rax)
cmpq $-0x1, -0x78(%rbp)
je 0x587fb
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x58a1d
jmp 0x587fd
leaq -0x99(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x45f0
movq -0x140(%rbp), %rdx
leaq 0x3774f(%rip), %rsi     # 0x8ff6d
leaq -0x98(%rbp), %rdi
callq 0x4450
jmp 0x5882c
leaq -0x99(%rbp), %rdi
callq 0x4380
movq -0x18(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x566e0
jmp 0x5884a
leaq 0x37777(%rip), %rsi     # 0x8ffc8
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x15d60
jmp 0x58866
leaq -0x98(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x43f0
jmp 0x5887b
leaq -0xd0(%rbp), %rdi
callq 0x4688
leaq -0xf0(%rbp), %rdi
callq 0x4688
movq -0x20(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x566e0
jmp 0x588a5
leaq 0x37724(%rip), %rsi     # 0x8ffd0
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rdx
callq 0x15d60
jmp 0x588c1
leaq -0x98(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x43f0
jmp 0x588d6
leaq -0x110(%rbp), %rdi
callq 0x4688
leaq -0x130(%rbp), %rdi
callq 0x4688
movl $0x28, %edi
callq 0x41c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
movl $0xf, %esi
leaq -0x98(%rbp), %rdx
callq 0x73a90
jmp 0x58918
movq -0x148(%rbp), %rdi
leaq 0x6d42a(%rip), %rsi     # 0xc5d50
leaq -0x42a9d(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x58a36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x4380
jmp 0x58a2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x58a0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x589a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4688
leaq -0xf0(%rbp), %rdi
callq 0x4688
jmp 0x58a0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x589e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x4688
leaq -0x130(%rbp), %rdi
callq 0x4688
jmp 0x58a0f
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
callq 0x4280
leaq -0x98(%rbp), %rdi
callq 0x4688
jmp 0x58a2a
movq -0x8(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xa8(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)