// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseExpression.cpp
// Function: ParseExpression::generate_expression(ExpressionType, ParseExpression const&)
const ParseExpression &ParseExpression::generate_expression(
        ExpressionType type, const ParseExpression &expr) {
    ParseExpression res;
    res.expr_type = type;
    res.child[0] = get_expr_id(expr);
    switch (type) {
        case E_ADR:
        case E_PTR:
            // 未实现
            break;
        case E_NEG:
        case E_POS:
        case E_BIT_NOT:
        case E_NOT: {
            res.ret_type_id = expr.get_ret_type().get_id();
            if (expr.is_const()) {
                res.calculate_const();
            }
            break;
        }
        case E_GET_ITEM:
        case E_UNDEFINED:
        case E_VAR:
        case E_FUN:
        case E_CONST:
        case E_ASSIGN:
        case E_ADD:
        case E_SUB:
        case E_MUL:
        case E_DIV:
        case E_MOD:
        case E_POW:
        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: {
            // 错误调用该函数
            string info = "ParseExpression::generate_expression("
                          "ExpressionType type, const ParseExpression &expr)";
            info += " expr=" + to_string(expr.get_id());;
            throw ParseException(EX_EXPRESSION_CAN_NOT_GENERATE, info);
        }
    }
    update(res);
    return get_expression(res.get_id());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movl %edi, %r14d
orq $-0x1, -0x20(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x30(%rbp)
movl %edi, -0x18(%rbp)
movq %rsi, %rdi
callq 0x25a38
movq %rax, -0x40(%rbp)
cmpl $0x19, %r14d
ja 0x257ce
movl $0x1c800, %eax          # imm = 0x1C800
btl %r14d, %eax
jae 0x257c3
movq %rbx, %rdi
callq 0x249b0
movq %rax, %rdi
callq 0x212de
movq %rax, -0x20(%rbp)
movq %rbx, %rdi
callq 0x24972
testb %al, %al
je 0x257ce
leaq -0x40(%rbp), %rdi
callq 0x2b9ac
jmp 0x257ce
movl $0x3fe07ff, %eax        # imm = 0x3FE07FF
btl %r14d, %eax
jb 0x25803
leaq -0x40(%rbp), %rdi
callq 0x24716
leaq -0x40(%rbp), %rdi
callq 0x25a38
movq %rax, %rdi
callq 0x247e8
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x25150
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x15c1c(%rip), %rsi     # 0x3b426
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x4130
movq %rbx, %rdi
callq 0x25a38
leaq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0xc865
leaq 0x15c48(%rip), %rsi     # 0x3b47d
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0xc837
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4580
leaq -0x60(%rbp), %rdi
callq 0x4598
leaq -0x80(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0x10
popq %rsi
leaq -0xa0(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x2d4e8(%rip), %rsi     # 0x52d70
leaq -0x18fe7(%rip), %rdx    # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x258c2
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
jmp 0x258c5
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x4598
jmp 0x258b7
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x4598
jmp 0x258c5
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x4598
jmp 0x258d8
jmp 0x258d5
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x25150
movq %rbx, %rdi
callq 0x4500
nop