// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movq $-0x1, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x40(%rbp)
movl %edi, -0x28(%rbp)
movq 0x10(%rsi), %rax
testq %rax, %rax
jne 0x2cc15
movq %rbx, %rdi
callq 0x2b7a0
movq 0x10(%rbx), %rax
movq %rax, -0x50(%rbp)
cmpl $0x19, %r14d
ja 0x2cc60
movl $0x1c800, %eax          # imm = 0x1C800
btl %r14d, %eax
jae 0x2cc55
movq %rbx, %rdi
callq 0x2bbcc
movq %rax, %rdi
callq 0x2770a
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2bb90
testb %al, %al
je 0x2cc60
leaq -0x50(%rbp), %rdi
callq 0x343a4
jmp 0x2cc60
movl $0x3fe07ff, %eax        # imm = 0x3FE07FF
btl %r14d, %eax
jb 0x2cca1
leaq -0x50(%rbp), %rdi
callq 0x2b7a0
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
jne 0x2cc7f
leaq -0x50(%rbp), %rdi
callq 0x2b7a0
movq -0x40(%rbp), %rdi
callq 0x2b8a6
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2c47e
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a7de(%rip), %rsi     # 0x4748e
leaq 0x1a82d(%rip), %rdx     # 0x474e4
leaq -0x90(%rbp), %rdi
callq 0xf65c
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
jne 0x2ccd8
movq %rbx, %rdi
callq 0x2b7a0
movq 0x10(%rbx), %rsi
leaq -0xb0(%rbp), %rdi
callq 0xe329
leaq 0x1a7fa(%rip), %rsi     # 0x474e5
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0xe2af
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x4110
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cd21
callq 0x42b0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cd36
callq 0x42b0
movl $0x28, %edi
callq 0x4190
movq %rax, %r14
leaq -0x90(%rbp), %rdx
movq %rax, %rdi
movl $0x10, %esi
callq 0x33d12
leaq 0x2f012(%rip), %rsi     # 0x5bd70
leaq -0x1e9ab(%rip), %rdx    # 0xe3ba
movq %r14, %rdi
callq 0x4540
jmp 0x2cdad
movq %rax, %rbx
movq %r14, %rdi
callq 0x4250
jmp 0x2cdb0
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cd96
callq 0x42b0
jmp 0x2cd96
movq %rax, %rbx
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cdb0
callq 0x42b0
jmp 0x2cdb0
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x2cdc8
callq 0x42b0
jmp 0x2cdc8
jmp 0x2cdc5
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2c47e
movq %rbx, %rdi
callq 0x4560
nop