// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseTree.cpp
// Function: ParseTree::print_node(unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>&, unsigned long, bool, bool*) const
void ParseTree::print_node(size_t node_id, vector<size_t> &has_next_children,
                           size_t depth, bool last_child, bool *vis) const {
    if (node_id != 0) {
        if (last_child) {
            printf(" |_");
        } else {
            printf(" |-");
        }
    }
    try {
        printf("%zu:%s\n", node_id, nodes[node_id].get_node_info().c_str());
    } catch (ParseException &ext) {
        printf("!ExceptionNode %zu:%s\n", node_id, ParseNode::get_node_type_name(nodes[node_id].type).c_str());
    }
    vis[node_id] = true;
    string pre_fix;
    for (size_t i = 1; i < depth; ++i) {
        pre_fix.append("  ");
    }
    for (auto each : has_next_children) {
        pre_fix[1 + 2 * (each - 1)] = '|';
    }
    for (size_t i = 0; i < node_children[node_id].size(); ++i) {
        size_t next_node = node_children[node_id][i];
        printf("%s", pre_fix.c_str());
        if (has_next_children.empty() || has_next_children[has_next_children.size() - 1] < depth) {
            has_next_children.push_back(depth);
        }
        if (i == node_children[node_id].size() - 1) {
            auto it = find(has_next_children.begin(), has_next_children.end(), depth);
            if (it != has_next_children.end()) {
                has_next_children.erase(it);
            }
            print_node(next_node, has_next_children, depth + 1, true, vis);
        } else {
            print_node(next_node, has_next_children, depth + 1, false, vis);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, -0x38(%rbp)
movq %rcx, %r13
movq %rdx, %r14
movq %rdi, %r15
movq %rcx, -0x30(%rbp)
movq %rsi, -0x40(%rbp)
testq %rsi, %rsi
je 0x15653
leaq 0x25062(%rip), %rax     # 0x3a6a0
leaq 0x2505f(%rip), %rdi     # 0x3a6a4
testb %r8b, %r8b
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x4060
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
shlq $0x5, %rsi
addq (%r15), %rsi
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x18228
movq (%r12), %rdx
leaq 0x25030(%rip), %rdi     # 0x3a6a8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4060
movq %r12, %rdi
callq 0x4598
movq -0x38(%rbp), %rax
movb $0x1, (%rax,%rbx)
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x1
popq %r12
leaq 0x25003(%rip), %rbx     # 0x3a6b0
cmpq %r13, %r12
jae 0x156c3
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x4540
incq %r12
jmp 0x156ad
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rcx, %rax
je 0x156e1
movq (%rax), %rdx
movq -0x60(%rbp), %rsi
movb $0x7c, -0x1(%rsi,%rdx,2)
addq $0x8, %rax
jmp 0x156ca
imulq $0x18, -0x40(%rbp), %rbx
xorl %r13d, %r13d
movq 0x60(%r15), %rcx
movq (%rcx,%rbx), %rax
movq 0x8(%rcx,%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jae 0x157b8
movq (%rax,%r13,8), %r12
movq -0x60(%rbp), %rsi
leaq 0x26156(%rip), %rdi     # 0x3b86b
xorl %eax, %eax
callq 0x4060
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
je 0x1572f
movq -0x8(%rax), %rax
cmpq -0x30(%rbp), %rax
jae 0x1573b
movq %r14, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1645e
movq 0x60(%r15), %rax
movq 0x8(%rax,%rbx), %rcx
subq (%rax,%rbx), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rcx, %r13
jne 0x15794
movq (%r14), %rdi
movq 0x8(%r14), %rsi
leaq -0x30(%rbp), %rdx
callq 0x174a3
cmpq 0x8(%r14), %rax
je 0x15775
movq %r14, %rdi
movq %rax, %rsi
callq 0x16486
movq -0x30(%rbp), %rcx
incq %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
pushq $0x1
popq %r8
movq -0x38(%rbp), %r9
callq 0x1560c
jmp 0x157b0
movq -0x30(%rbp), %rcx
incq %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movq -0x38(%rbp), %r9
callq 0x1560c
incq %r13
jmp 0x156e9
leaq -0x60(%rbp), %rdi
callq 0x4598
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x157d4
jmp 0x157d4
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x4598
movq %rbx, %rdi
callq 0x4500