// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro11/assemble_aux.c
// Function: complex_tree
int complex_tree(
    TEXT_COMPLEX *tx,
    EX_TREE *tree)
{
    switch (tree->type) {
    case EX_LIT:
        text_complex_lit(tx, tree->data.lit);
        return 1;

    case EX_TEMP_SYM:
    case EX_SYM:
        {
            SYMBOL         *sym = tree->data.symbol;

            if ((sym->flags & (SYMBOLFLAG_GLOBAL | SYMBOLFLAG_DEFINITION)) == SYMBOLFLAG_GLOBAL) {
                text_complex_global(tx, sym->label);
            } else {
                text_complex_psect(tx, sym->section->sector, sym->value);
            }
        }
        return 1;

    case EX_COM:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        text_complex_com(tx);
        return 1;

    case EX_NEG:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        text_complex_neg(tx);
        return 1;

    case EX_ADD:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_add(tx);
        return 1;

    case EX_SUB:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_sub(tx);
        return 1;

    case EX_MUL:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_mul(tx);
        return 1;

    case EX_DIV:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_div(tx);
        return 1;

    case EX_AND:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_and(tx);
        return 1;

    case EX_OR:
        if (!complex_tree(tx, tree->data.child.left))
            return 0;
        if (!complex_tree(tx, tree->data.child.right))
            return 0;
        text_complex_or(tx);
        return 1;

    default:
        return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rsi), %eax
xorl %ebx, %ebx
decl %eax
cmpl $0xc, %eax
ja 0x6193
movq %rsi, %r15
movq %rdi, %r14
leaq 0xa1f8(%rip), %rcx      # 0x101d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r15), %rax
movl 0x10(%rax), %ecx
andl $0xa, %ecx
cmpl $0x2, %ecx
jne 0x617c
movq (%rax), %rsi
movq %r14, %rdi
callq 0xda2a
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd8e7
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd88d
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd941
jmp 0x618e
movl 0x10(%r15), %esi
movq %r14, %rdi
callq 0xd9f5
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd99b
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd9c8
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd860
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd8ba
jmp 0x618e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5fbb
testl %eax, %eax
je 0x6193
movq %r14, %rdi
callq 0xd914
jmp 0x618e
movq 0x18(%rax), %rcx
movl 0x18(%rcx), %esi
movl 0x8(%rax), %edx
movq %r14, %rdi
callq 0xda84
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq