// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseExpression.cpp
// Function: ParseExpression::get_ret_type() const
const ParseType &ParseExpression::get_ret_type() const {
    if (ret_type_id != (size_t) -1) {
        return ParseType::get_type(ret_type_id);
    }
    // -1表示未经过计算
    switch (expr_type) {
        case E_ADD:
        case E_SUB:
        case E_MUL:
        case E_DIV:
        case E_MOD:
        case E_POW: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            try {
                ret_cache = ParseType::convert(expr_type,
                                               get_expression(child[0]).get_ret_type(),
                                               get_expression(child[1]).get_ret_type()
                );
            } catch (ParseException &exc) {
                string info = "in ParseExpression::get_ret_type()";
                info += " expr=" + to_string(get_id());
                exc.push_trace(info);
                throw exc;
            }
            return ParseType::get_type(ret_cache);
        }
        case E_CONST: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = ParseType(*((ParseConstant *) child[0])).get_id();
            return ParseType::get_type(ret_cache);
        }
        case E_VAR: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = ((ParseVariable *) child[0])->get_type().get_id();
            return ParseType::get_type(ret_cache);
        }
        case E_ADR:
        case E_PTR:
        case E_NEG:
        case E_POS:
        case E_BIT_NOT:
        case E_NOT: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = get_expression(child[0]).get_ret_type().get_id();
            return ParseType::get_type(ret_cache);
        }
        case E_GET_ITEM : {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = get_expression(child[0]).get_ret_type().get_lower_type().get_id();
            break;
        }
        case E_LOGIC_OR:
        case E_LOGIC_AND:
        case E_G:
        case E_GE:
        case E_EQUAL:
        case E_NE:
        case E_L:
        case E_LE: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = T_BOOL;
            return ParseType::get_type(ret_cache);
        }
        case E_ASSIGN: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            ret_cache = ParseType::convert(E_ASSIGN,
                                           get_expression(child[0]).get_ret_type(),
                                           get_expression(child[1]).get_ret_type());
            return ParseType::get_type(ret_cache);
        }
        case E_UNDEFINED:
            break;
        case E_FUN: {
            size_t &ret_cache = (((ParseExpression *) this)->ret_type_id);
            const DecFuncPtrList &fun_ptrs = *(DecFuncPtrList *)(child[0]);
            ret_cache = (fun_ptrs[0])->get_ret_type().get_id();
            return ParseType::get_type(ret_cache);
        }
    }
    ((ParseExpression *) this)->ret_type_id = 0;
    return ParseType::get_type(T_UNKNOWN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
cmpq $-0x1, %rdi
jne 0x24a4f
movl 0x28(%rbx), %r14d
leal -0x1(%r14), %eax
cmpl $0x18, %eax
ja 0x24adf
leaq 0x166e6(%rip), %rcx     # 0x3b0cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x1, 0x20(%rbx)
pushq $0x1
popq %rdi
jmp 0x24a4f
movq (%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
movq %rax, %r15
movq 0x8(%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
movl %r14d, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x224c2
jmp 0x24a48
movq (%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
movq %rax, %rdi
callq 0x212de
movq %rax, 0x20(%rbx)
movq %rax, %rdi
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21a26
movq (%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
movq %rax, %r14
movq 0x8(%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
pushq $0x19
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x224c2
jmp 0x24a48
movq (%rbx), %rsi
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x21302
movq %r14, %rdi
callq 0x212de
jmp 0x24b12
movq (%rbx), %rdi
callq 0x247e8
movq %rax, %rdi
callq 0x249b0
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x22964
movq %r14, %rdi
callq 0x212de
movq %rax, 0x20(%rbx)
leaq -0x50(%rbp), %rdi
callq 0x21c36
andq $0x0, 0x20(%rbx)
xorl %edi, %edi
jmp 0x24b23
movq (%rbx), %rdi
callq 0x274f6
jmp 0x24a40
movq (%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x27666
movq %r14, %rdi
callq 0x212de
movq %rax, 0x20(%rbx)
leaq -0x50(%rbp), %rdi
callq 0x21c36
movq 0x20(%rbx), %rdi
callq 0x21a26
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x24b37
jmp 0x24b37
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x21c36
jmp 0x24c32
movq %rax, %r14
cmpl $0x1, %edx
jne 0x24c32
movq %r14, %rdi
callq 0x4140
movq %rax, %r14
leaq 0x16a23(%rip), %rsi     # 0x3b589
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x4130
movq %rbx, %rdi
callq 0x25a38
leaq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0xc865
leaq 0x168ec(%rip), %rsi     # 0x3b47d
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0xc837
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4580
leaq -0x70(%rbp), %rdi
callq 0x4598
leaq -0x90(%rbp), %rdi
callq 0x4598
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x2b7ea
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2b876
leaq 0x2e184(%rip), %rsi     # 0x52d70
leaq -0x1834b(%rip), %rdx    # 0xc8a8
movq %rbx, %rdi
callq 0x44e0
jmp 0x24c1c
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x4598
jmp 0x24c0e
movq %rax, %r14
leaq -0x90(%rbp), %rdi
callq 0x4598
jmp 0x24c1f
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x4598
jmp 0x24c2d
movq %rax, %r14
callq 0x44b0
movq %r14, %rdi
callq 0x4500
movq %rax, %rdi
callq 0xca0b