// File: 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
subq $0x110, %rsp            # imm = 0x110
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x61e30
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x63830
movq %rax, -0xc0(%rbp)
jmp 0x63333
movq -0xc0(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xc4(%rbp)
subl $0xb, %eax
jb 0x63409
jmp 0x63352
movl -0xc4(%rbp), %eax
subl $0xb, %eax
je 0x633a8
jmp 0x6335f
movl -0xc4(%rbp), %eax
addl $-0xc, %eax
subl $0x2, %eax
jb 0x633a3
jmp 0x6336f
movl -0xc4(%rbp), %eax
addl $-0xe, %eax
subl $0x3, %eax
jb 0x633a8
jmp 0x6337f
movl -0xc4(%rbp), %eax
addl $-0x11, %eax
subl $0x9, %eax
jb 0x63409
jmp 0x6356d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x635b8
jmp 0x6356d
movq -0x10(%rbp), %rdi
callq 0x61800
movq %rax, -0xd0(%rbp)
jmp 0x633ba
movq -0xd0(%rbp), %rdi
callq 0x56260
movq %rax, -0xd8(%rbp)
jmp 0x633cf
movq -0xd8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x61790
movb %al, -0xd9(%rbp)
jmp 0x633eb
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x633f7
jmp 0x63404
leaq -0x40(%rbp), %rdi
callq 0x74b60
jmp 0x63402
jmp 0x63404
jmp 0x6356d
leaq -0x71(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x45f0
movq -0xe8(%rbp), %rdx
leaq 0x2d04f(%rip), %rsi     # 0x90476
leaq -0x70(%rbp), %rdi
callq 0x4450
jmp 0x63432
leaq -0x71(%rbp), %rdi
callq 0x4380
movq -0x10(%rbp), %rdi
callq 0x63810
movq %rax, -0xf0(%rbp)
jmp 0x6344d
movq -0xf0(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x15db0
jmp 0x63462
leaq 0x2d064(%rip), %rsi     # 0x904cd
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x15d60
jmp 0x6347e
leaq -0x70(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x43f0
jmp 0x63490
leaq -0x98(%rbp), %rdi
callq 0x4688
leaq -0xb8(%rbp), %rdi
callq 0x4688
movl $0x28, %edi
callq 0x41c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf8(%rbp)
movl $0x10, %esi
leaq -0x70(%rbp), %rdx
callq 0x73a90
jmp 0x634cf
movq -0xf8(%rbp), %rdi
leaq 0x62873(%rip), %rsi     # 0xc5d50
leaq -0x4d654(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x635ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x4380
jmp 0x635b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x63562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6353c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4688
leaq -0xb8(%rbp), %rdi
callq 0x4688
jmp 0x63562
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x4280
leaq -0x70(%rbp), %rdi
callq 0x4688
jmp 0x635b8
leaq -0x40(%rbp), %rdi
callq 0x60e20
jmp 0x63578
leaq -0x40(%rbp), %rdi
callq 0x63810
movq %rax, -0x100(%rbp)
jmp 0x6358a
movq -0x100(%rbp), %rdi
callq 0x60f30
movq %rax, -0x108(%rbp)
jmp 0x6359f
leaq -0x40(%rbp), %rdi
callq 0x62810
movq -0x108(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x62810
movq -0x48(%rbp), %rdi
callq 0x45e0
nopw (%rax,%rax)