// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: iterator_equal_1
static bool iterator_equal_1(s7_scheme *sc, s7_pointer x, s7_pointer y, shared_info *ci, bool equivalent)
                {
                    s7_pointer x_seq, y_seq, xs, ys;

                    if (x == y) return(true);
                    if (!is_iterator(y)) return(false);

                    x_seq = iterator_sequence(x);
                    y_seq = iterator_sequence(y);

                    switch (type(x_seq))
                    {
                        case T_STRING:
                            return((is_string(y_seq)) &&
                                    (iterator_position(x) == iterator_position(y)) &&
                                    (iterator_length(x) == iterator_length(y)) &&
                                    (string_equal(sc, x_seq, y_seq, ci)));

                        case T_VECTOR: case T_INT_VECTOR: case T_BYTE_VECTOR: case T_FLOAT_VECTOR:
                            return((is_any_vector(y_seq)) &&
                                    (iterator_position(x) == iterator_position(y)) &&
                                    (iterator_length(x) == iterator_length(y)) &&
                                    ((equivalent) ? (vector_equivalent(sc, x_seq, y_seq, ci)) : (vector_equal(sc, x_seq, y_seq, ci))));

                            /* iterator_next is a function (pair_iterate, iterator_finished etc) */
                        case T_PAIR:
                            if (iterator_next(x) != iterator_next(y)) return(false);     /* even if seqs are equal, one might be at end */
                            if (equivalent)
                            {
                                if (!pair_equivalent(sc, x_seq, y_seq, ci))
                                    return(false);
                            }
                            else
                            {
                                if (!pair_equal(sc, x_seq, y_seq, ci))
                                    return(false);
                            }
                            for (xs = x_seq, ys = y_seq; is_pair(xs) && is_pair(ys); xs = cdr(xs), ys = cdr(ys))
                                if (xs == iterator_current(x))
                                    return(ys == iterator_current(y));
                            return(is_null(xs) && is_null(ys));

                        case T_NIL:                                                    /* (make-iterator #()) works, so () should too */
                            return(is_null(y_seq));   /* perhaps for equivalent case, check position in y as well as pair(seq(y))? */

                        case T_C_OBJECT:
                            if ((is_c_object(y_seq)) &&
                                    (iterator_position(x) == iterator_position(y)) &&
                                    (iterator_length(x) == iterator_length(y)))
                            {
                                if (equivalent)
                                    return(c_object_equivalent(sc, x_seq, y_seq, ci));
                                return(c_objects_are_equal(sc, x_seq, y_seq, ci));
                            }
                            return(false);

                        case T_LET:
                            if (!is_let(y_seq)) return(false);
                            if (iterator_next(x) != iterator_next(y)) return(false);
                            if (x_seq == sc->rootlet)
                                return(iterator_position(x) == iterator_position(y)); /* y_seq must also be sc->rootlet since nexts are the same (rootlet_iterate) */
                            if (equivalent)
                            {
                                if (!let_equivalent(sc, x_seq, y_seq, ci))
                                    return(false);
                            }
                            else
                            {
                                if (!let_equal(sc, x_seq, y_seq, ci))
                                    return(false);
                            }
                            for (xs = let_slots(x_seq), ys = let_slots(y_seq); tis_slot(xs) && tis_slot(ys); xs = next_slot(xs), ys = next_slot(ys))
                                if (xs == iterator_current_slot(x))
                                    return(ys == iterator_current_slot(y));
                            return(is_slot_end(xs) && is_slot_end(ys));

                        case T_HASH_TABLE:
                            if (!is_hash_table(y_seq)) return(false);
                            if (hash_table_entries(x_seq) != hash_table_entries(y_seq)) return(false);
                            if (hash_table_entries(x_seq) == 0) return(true);
                            if (iterator_position(x) != iterator_position(y)) return(false);
                            if (!equivalent)
                                return(hash_table_equal(sc, x_seq, y_seq, ci));
                            return(hash_table_equivalent(sc, x_seq, y_seq, ci));

                        case T_CLOSURE: case T_CLOSURE_STAR:
                            return(x_seq == y_seq); /* or closure_equal/equivalent? */

                        default:
                            break;
                    }
                    return(false);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %bpl
cmpq %rdx, %rsi
je 0xf8355
movq %rdx, %r15
cmpb $0x1d, (%rdx)
jne 0xf8353
movq %rsi, %r12
movq %rdi, %r13
movq 0x8(%rsi), %r14
movq 0x8(%r15), %rbx
movzbl (%r14), %eax
xorl %ebp, %ebp
leal -0x13(%rax), %edx
cmpl $0x16, %edx
ja 0xf819c
leaq 0x10c44(%rip), %rax     # 0x108d80
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movzbl (%rbx), %eax
leaq 0x52ad1(%rip), %rdx     # 0x14ac20
cmpb $0x1, (%rax,%rdx)
jne 0xf8353
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xf8353
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xf8353
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
testb %r8b, %r8b
je 0xf831b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf7956
cmpl $0x1, %eax
je 0xf82fb
cmpl $0x2, %eax
jne 0xf8355
cmpq 0x110(%r13), %rbx
jmp 0xf81ba
cmpq %rbx, %r14
sete %bpl
jmp 0xf8355
cmpb $0x1b, (%rbx)
jne 0xf8353
movq 0x28(%r14), %rax
movq 0x18(%rax), %rax
movq 0x28(%rbx), %rdx
cmpq 0x18(%rdx), %rax
jne 0xf8353
movb $0x1, %bpl
testq %rax, %rax
je 0xf8355
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xf8353
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xf840a
movl $0x1, %r8d
jmp 0xf840d
cmpb $0x13, (%rbx)
jne 0xf8353
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xf8353
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xf8353
movq 0x8(%r14), %rdx
cmpq 0x8(%rbx), %rdx
jne 0xf8353
movq 0x10(%r14), %rdi
movq 0x10(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8c146
cmpb $0x1c, (%rbx)
jne 0xf8353
movq 0x28(%r12), %rax
cmpq 0x28(%r15), %rax
jne 0xf8353
cmpq 0x150(%r13), %r14
je 0xf837f
testb %r8b, %r8b
je 0xf839c
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xf7313
testb %al, %al
je 0xf8353
jmp 0xf83b8
cmpb $0x14, (%rbx)
jne 0xf8353
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xf8353
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xf8353
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
testb %r8b, %r8b
je 0xf838d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf700c
movq 0x28(%r12), %rax
cmpq 0x28(%r15), %rax
jne 0xf8353
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xf832a
callq 0xf74c6
jmp 0xf832f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6a20
callq 0xf6653
testb %al, %al
je 0xf8353
cmpb $0x1, (%r14)
jne 0xf836a
cmpb $0x1, (%rbx)
jne 0xf836a
cmpq 0x10(%r12), %r14
je 0xf841d
movq 0x10(%r14), %r14
movq 0x10(%rbx), %rbx
jmp 0xf8333
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x110(%r13), %rax
xorq %rax, %r14
xorq %rax, %rbx
orq %r14, %rbx
jmp 0xf81ba
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jmp 0xf81ba
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6314
cmpq %rbx, %r14
je 0xf83b8
xorl %ebp, %ebp
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0xf8845
testb %al, %al
je 0xf8355
movq 0x8(%rbx), %rax
movq 0x8(%r14), %rcx
testq %rcx, %rcx
setne %bpl
testq %rax, %rax
setne %dl
movl %ebp, %esi
andb %dl, %sil
cmpb $0x1, %sil
jne 0xf83fe
movq 0x18(%r12), %rsi
cmpq %rsi, %rcx
je 0xf8384
movq 0x18(%rax), %rax
movq 0x18(%rcx), %rcx
testq %rax, %rax
setne %dl
testq %rcx, %rcx
setne %bpl
je 0xf83fe
testq %rax, %rax
jne 0xf83dd
orb %dl, %bpl
xorb $0x1, %bpl
jmp 0xf8355
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf8426
cmpq 0x10(%r15), %rbx
jmp 0xf81ba