// File: /workspace/github_cpp_makefile_star2_O1/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, -0x40(%rbp)
movq %rdx, %r14
movq %rdi, %r15
movq %rcx, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
testq %rsi, %rsi
je 0x17f36
leaq 0x2e773(%rip), %rax     # 0x46694
leaq 0x2e770(%rip), %rdi     # 0x46698
testb %r8b, %r8b
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x4070
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
shlq $0x5, %rsi
addq (%r15), %rsi
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x1a810
movq (%r12), %rdx
leaq 0x2e741(%rip), %rdi     # 0x4669c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4070
movq (%r12), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x17f77
callq 0x42b0
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x1, (%rax,%rcx)
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
cmpq $0x2, -0x30(%rbp)
jb 0x17fbe
movl $0x1, %ebx
leaq 0x2e6fa(%rip), %r13     # 0x466a4
movq %r12, %rdi
movq %r13, %rsi
callq 0x45c0
incq %rbx
cmpq -0x30(%rbp), %rbx
jb 0x17faa
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rcx, %rax
je 0x17fdc
movq (%rax), %rdx
movq -0x60(%rbp), %rsi
movb $0x7c, -0x1(%rsi,%rdx,2)
addq $0x8, %rax
jmp 0x17fc5
movq 0x60(%r15), %rcx
movq -0x38(%rbp), %rax
leaq (%rax,%rax,2), %r12
movq (%rcx,%r12,8), %rax
cmpq %rax, 0x8(%rcx,%r12,8)
je 0x180ed
xorl %ebx, %ebx
movq (%rax,%rbx,8), %r13
movq -0x60(%rbp), %rsi
leaq 0x2f8cb(%rip), %rdi     # 0x478d3
xorl %eax, %eax
callq 0x4070
movq 0x8(%r14), %rsi
cmpq %rsi, (%r14)
je 0x18022
movq -0x8(%rsi), %rax
cmpq -0x30(%rbp), %rax
jae 0x18045
cmpq 0x10(%r14), %rsi
je 0x18039
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%r14)
jmp 0x18045
movq %r14, %rdi
leaq -0x30(%rbp), %rdx
callq 0x19b5e
movq 0x60(%r15), %rax
movq 0x8(%rax,%r12,8), %rcx
subq (%rax,%r12,8), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rcx, %rbx
jne 0x180b1
movq (%r14), %rdi
movq 0x8(%r14), %rsi
leaq -0x30(%rbp), %rdx
callq 0x19d6f
movq 0x8(%r14), %rdx
cmpq %rdx, %rax
je 0x18090
leaq 0x8(%rax), %rsi
cmpq %rdx, %rsi
je 0x1808b
subq %rsi, %rdx
movq %rax, %rdi
callq 0x44f0
addq $-0x8, 0x8(%r14)
movq -0x30(%rbp), %rcx
incq %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl $0x1, %r8d
movq -0x40(%rbp), %r9
callq 0x17ef2
jmp 0x180cd
movq -0x30(%rbp), %rcx
incq %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
movq -0x40(%rbp), %r9
callq 0x17ef2
incq %rbx
movq 0x60(%r15), %rcx
movq (%rcx,%r12,8), %rax
movq 0x8(%rcx,%r12,8), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbx
jb 0x17ff9
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x180ff
callq 0x42b0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18112
jmp 0x18112
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x18127
callq 0x42b0
movq %rbx, %rdi
callq 0x4560
nop