// File: acliusBackHome[P]kamaya/dist/ParseTreeErrorHandle.cpp
// Function: ParseTree::last_combine()
void ParseTree::last_combine() {
    int idx = 0;
    set<size_t> tmp_nodes(last_nodes);
    for (auto i : tmp_nodes) {
        if (idx >= error_nodes.size()) {
#ifdef PARSE_TREE_DEBUG
            puts("ParseTree::last_combine log: OUT RANGE OF ERROR NODES.");
#endif
            break;
        }
        if (i == error_nodes[idx]) {
#ifdef PARSE_TREE_DEBUG
            puts("ParseTree::last_combine log: SAME TAG ERROR AND LAST OF NODE.");
#endif
            continue;
        }
        if (i > error_nodes[idx]) { // 必须在逻辑上保证错误节点不是剩余节点
            idx++;
        }
        if (native_root(error_nodes[idx]) == i) { // 错误结点位于以 i 为根的树
            continue;
        }
        set_parent(i, error_nodes[idx]); // 必须保证在程序正确的情况下错误节点能容纳所有剩余节点
    }
    for (auto i : last_nodes) {
        set_parent(i, 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x98(%rbp)
movl $0x0, -0xc(%rbp)
addq $0x78, %rsi
leaq -0x40(%rbp), %rdi
callq 0x733e0
leaq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x73410
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x341a0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x34130
testb $0x1, %al
jne 0x72ab6
jmp 0x72c17
leaq -0x50(%rbp), %rdi
callq 0x73440
movq -0x98(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0xa0(%rbp)
addq $0x48, %rdi
callq 0x16570
movq %rax, %rcx
movq -0xa0(%rbp), %rax
cmpq %rcx, %rax
jb 0x72b1d
leaq 0x1e651(%rip), %rdi     # 0x91148
callq 0x4500
jmp 0x72afe
jmp 0x72c17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x20750
jmp 0x72ca4
movq -0x98(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0xa8(%rbp)
addq $0x48, %rdi
movslq -0xc(%rbp), %rsi
callq 0x34060
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq (%rcx), %rax
jne 0x72b5e
leaq 0x1e62d(%rip), %rdi     # 0x9117f
callq 0x4500
jmp 0x72b59
jmp 0x72c09
movq -0x98(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0xb0(%rbp)
addq $0x48, %rdi
movslq -0xc(%rbp), %rsi
callq 0x34060
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq (%rcx), %rax
jbe 0x72b95
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x98(%rbp), %rdi
addq $0x48, %rdi
movslq -0xc(%rbp), %rsi
callq 0x34060
movq -0x98(%rbp), %rdi
movq (%rax), %rsi
callq 0x72cb0
movq %rax, -0xb8(%rbp)
jmp 0x72bc1
movq -0xb8(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x72bd0
jmp 0x72c09
movq -0x98(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0xc0(%rbp)
addq $0x48, %rdi
movslq -0xc(%rbp), %rsi
callq 0x34060
movq -0x98(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq (%rax), %rdx
callq 0x31e60
jmp 0x72c07
jmp 0x72c09
leaq -0x50(%rbp), %rdi
callq 0x73470
jmp 0x72aa0
movq -0x98(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x73410
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0x341a0
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x34130
testb $0x1, %al
jne 0x72c59
jmp 0x72c92
leaq -0x80(%rbp), %rdi
callq 0x73440
movq -0x98(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31e60
jmp 0x72c85
jmp 0x72c87
leaq -0x80(%rbp), %rdi
callq 0x73470
jmp 0x72c43
leaq -0x40(%rbp), %rdi
callq 0x20750
addq $0xc0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x45e0
nopl (%rax)