// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_tree_count
static s7_pointer g_tree_count(s7_scheme *sc, s7_pointer args)
                {
#define H_tree_count "(tree-count obj tree max-count) returns how many times obj is in tree (using eq?), stopping at max-count (if specified)"
#define Q_tree_count s7_make_signature(sc, 4, sc->is_integer_symbol, sc->T, sc->T, sc->is_integer_symbol)
                    s7_pointer obj, tree, count;

                    obj = car(args);
                    tree = cadr(args);
                    if (!is_pair(tree))
                    {
                        if ((is_pair(cddr(args))) &&
                                (!is_t_integer(caddr(args))))
                            return(simple_wrong_type_argument(sc, sc->tree_count_symbol, caddr(args), T_INTEGER));
                        return((obj == tree) ? small_int(1) : small_int(0));
                    }
                    if ((sc->safety > NO_SAFETY) &&
                            (tree_is_cyclic(sc, tree)))
                        s7_error(sc, sc->wrong_type_arg_symbol, wrap_string(sc, "tree-count: tree is cyclic", 26));
                    if (is_null(cddr(args)))
                        return(s7_make_integer(sc, tree_count(sc, obj, tree, 0)));
                    count = caddr(args);
                    if (!s7_is_integer(count))
                        return(simple_wrong_type_argument(sc, sc->tree_count_symbol, count, T_INTEGER));
                    return(s7_make_integer(sc, tree_count_at_least(sc, obj, tree, 0, s7_integer(count))));
                }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0xa361a
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xa35e5
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0xb, %eax
je 0xa35e5
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x15f8(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x68(%rsp), %rax
movq 0x140(%rax), %rcx
movq 0x177012(%rip), %r8     # 0x21a5e8
callq 0x14a60
movq %rax, 0x70(%rsp)
jmp 0xa3791
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
jne 0xa35ff
movq 0x172e90(%rip), %rax    # 0x216488
movq %rax, 0x40(%rsp)
jmp 0xa360b
movq 0x172e7a(%rip), %rax    # 0x216480
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0xa3791
movq 0x68(%rsp), %rax
cmpq $0x0, 0x6a0(%rax)
jle 0xa3681
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2f870
testb $0x1, %al
jne 0xa363e
jmp 0xa3681
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x1940(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x150805(%rip), %rsi    # 0x1f3e6a
movl $0x1a, %edx
callq 0xb880
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0xa36d5
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xf76c0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x120f0
movq %rax, 0x70(%rsp)
jmp 0xa3791
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0xa3732
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x15f8(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x48(%rsp), %rdx
movq 0x68(%rsp), %rax
movq 0x140(%rax), %rcx
movq 0x176ec2(%rip), %r8     # 0x21a5e8
callq 0x14a60
movq %rax, 0x70(%rsp)
jmp 0xa3791
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
callq 0x10790
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rax, %r8
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d0200
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x120f0
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax,%rax)