// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/crossassemblers/macro11/extree.c
// Function: print_tree
void print_tree(
    FILE *printfile,
    EX_TREE *tp,
    int depth)
{
    SYMBOL         *sym;

    if (tp == NULL) {
        fprintf(printfile, "(null)");
        return;
    }

    switch (tp->type) {
    case EX_LIT:
        fprintf(printfile, "%o", tp->data.lit & 0177777);
        break;

    case EX_SYM:
    case EX_TEMP_SYM:
        sym = tp->data.symbol;
        fprintf(printfile, "%s{%s%o:%s}", tp->data.symbol->label, symflags(sym), sym->value,
                sym->section->label);
        break;

    case EX_UNDEFINED_SYM:
        fprintf(printfile, "%s{%o:undefined}", tp->data.symbol->label, tp->data.symbol->value);
        break;

    case EX_COM:
        fprintf(printfile, "^C<");
        print_tree(printfile, tp->data.child.left, depth + 4);
        fprintf(printfile, ">");
        break;

    case EX_NEG:
        fprintf(printfile, "-<");
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('>', printfile);
        break;

    case EX_ERR:
        fprintf(printfile, "{expression error}");
        if (tp->data.child.left) {
            fputc('<', printfile);
            print_tree(printfile, tp->data.child.left, depth + 4);
            fputc('>', printfile);
        }
        break;

    case EX_ADD:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('+', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;

    case EX_SUB:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('-', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;

    case EX_MUL:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('*', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;

    case EX_DIV:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('/', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;

    case EX_AND:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('&', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;

    case EX_OR:
        fputc('<', printfile);
        print_tree(printfile, tp->data.child.left, depth + 4);
        fputc('!', printfile);
        print_tree(printfile, tp->data.child.right, depth + 4);
        fputc('>', printfile);
        break;
    }

    if (depth == 0)
        fputc('\n', printfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8fa1
movq -0x8(%rbp), %rdi
leaq 0xc517(%rip), %rsi      # 0x154ac
movb $0x0, %al
callq 0x21c0
jmp 0x9385
movq -0x10(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xc, %eax
ja 0x9371
movq -0x28(%rbp), %rax
leaq 0xc419(%rip), %rcx      # 0x153dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
leaq 0xc4cf(%rip), %rsi      # 0x154b3
movb $0x0, %al
callq 0x21c0
jmp 0x9371
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0xdee0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq %rax, %rcx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %r9
leaq 0xc475(%rip), %rsi      # 0x154b6
movb $0x0, %al
callq 0x21c0
jmp 0x9371
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x8(%rax), %ecx
leaq 0xc454(%rip), %rsi      # 0x154c2
movb $0x0, %al
callq 0x21c0
jmp 0x9371
movq -0x8(%rbp), %rdi
leaq 0xc44e(%rip), %rsi      # 0x154d3
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rdi
leaq 0xc429(%rip), %rsi      # 0x154d7
movb $0x0, %al
callq 0x21c0
jmp 0x9371
movq -0x8(%rbp), %rdi
leaq 0xc414(%rip), %rsi      # 0x154d9
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rdi
leaq 0xc3db(%rip), %rsi      # 0x154dc
movb $0x0, %al
callq 0x21c0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x9146
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x2b, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x2d, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x2a, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x2f, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x26, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
jmp 0x9371
movq -0x8(%rbp), %rsi
movl $0x3c, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x21, %edi
callq 0x2150
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
addl $0x4, %edx
callq 0x8f70
movq -0x8(%rbp), %rsi
movl $0x3e, %edi
callq 0x2150
cmpl $0x0, -0x14(%rbp)
jne 0x9385
movq -0x8(%rbp), %rsi
movl $0xa, %edi
callq 0x2150
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)