// File: /workspace/github_c_makefile_star2_O3/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 0x60a3
movq %rsi, %r15
movq %rdi, %r14
leaq 0xa300(%rip), %rcx      # 0x101ec
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 0x608c
movq (%rax), %rsi
movq %r14, %rdi
callq 0xd78c
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd694
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd650
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd6d8
jmp 0x609e
movl 0x10(%r15), %esi
movq %r14, %rdi
callq 0xd760
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd71c
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd73e
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd62e
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd672
jmp 0x609e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5ecb
testl %eax, %eax
je 0x60a3
movq %r14, %rdi
callq 0xd6b6
jmp 0x609e
movq 0x18(%rax), %rcx
movl 0x18(%rcx), %esi
movl 0x8(%rax), %edx
movq %r14, %rdi
callq 0xd7ea
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq