// File: /workspace/github_c_makefile_star2_O2/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 0x5e69
movq %rsi, %r15
movq %rdi, %r14
leaq 0x9564(%rip), %rcx      # 0xf218
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 0x5e54
movq (%rax), %rsi
movq %r14, %rdi
callq 0xc59d
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc4b3
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc473
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc4f3
jmp 0x5e66
movl 0x10(%r15), %esi
movq %r14, %rdi
callq 0xc573
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc533
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc553
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc453
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc493
jmp 0x5e66
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x5c93
testl %eax, %eax
je 0x5e69
movq %r14, %rdi
callq 0xc4d3
jmp 0x5e66
movq 0x18(%rax), %rcx
movl 0x18(%rcx), %esi
movl 0x8(%rax), %edx
movq %r14, %rdi
callq 0xc5f9
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq