// File: /workspace/github_cpp_makefile_star2_O3/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 0x2c339
movq %rbx, %rdi
callq 0x2af00
movq 0x10(%rbx), %rax
movq %rax, -0x50(%rbp)
cmpl $0x19, %r14d
ja 0x2c384
movl $0x1c800, %eax          # imm = 0x1C800
btl %r14d, %eax
jae 0x2c379
movq %rbx, %rdi
callq 0x2b332
movq %rax, %rdi
callq 0x270b4
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2b2f4
testb %al, %al
je 0x2c384
leaq -0x50(%rbp), %rdi
callq 0x33a80
jmp 0x2c384
movl $0x3fe07ff, %eax        # imm = 0x3FE07FF
btl %r14d, %eax
jb 0x2c3c5
leaq -0x50(%rbp), %rdi
callq 0x2af00
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
jne 0x2c3a3
leaq -0x50(%rbp), %rdi
callq 0x2af00
movq -0x40(%rbp), %rdi
callq 0x2b006
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2bba0
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a0ba(%rip), %rsi     # 0x4648e
leaq 0x1a109(%rip), %rdx     # 0x464e4
leaq -0x90(%rbp), %rdi
callq 0xf868
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
jne 0x2c3fc
movq %rbx, %rdi
callq 0x2af00
movq 0x10(%rbx), %rsi
leaq -0xb0(%rbp), %rdi
callq 0xe50f
leaq 0x1a0d6(%rip), %rsi     # 0x464e5
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0xe495
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 0x2c445
callq 0x42b0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c45a
callq 0x42b0
movl $0x28, %edi
callq 0x4190
movq %rax, %r14
leaq -0x90(%rbp), %rdx
movq %rax, %rdi
movl $0x10, %esi
callq 0x333ee
leaq 0x2e8ee(%rip), %rsi     # 0x5ad70
leaq -0x1dee9(%rip), %rdx    # 0xe5a0
movq %r14, %rdi
callq 0x4540
jmp 0x2c4d1
movq %rax, %rbx
movq %r14, %rdi
callq 0x4250
jmp 0x2c4d4
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c4ba
callq 0x42b0
jmp 0x2c4ba
movq %rax, %rbx
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c4d4
callq 0x42b0
jmp 0x2c4d4
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c4ec
callq 0x42b0
jmp 0x2c4ec
jmp 0x2c4e9
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2bba0
movq %rbx, %rdi
callq 0x4560
nop