// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movb $0x1, %al
cmpq %rdx, %rsi
je 0xc5a9e
movq %rdx, %r15
cmpb $0x1d, (%rdx)
jne 0xc5a9c
movq %rsi, %r12
movq %rdi, %r13
movq 0x8(%rsi), %r14
movq 0x8(%r15), %rbx
movzbl (%r14), %edx
xorl %eax, %eax
leal -0x13(%rdx), %esi
cmpl $0x16, %esi
ja 0xc58a0
leaq 0xf52f(%rip), %rdx      # 0xd4d74
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movzbl (%rbx), %eax
leaq 0x543c8(%rip), %rdx     # 0x119c20
cmpb $0x1, (%rax,%rdx)
jne 0xc5a9c
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xc5a9c
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xc5a9c
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xc5a06
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc50f8
cmpl $0x1, %edx
je 0xc59e2
cmpl $0x2, %edx
jne 0xc5a9e
cmpq 0x110(%r13), %rbx
jmp 0xc58be
cmpq %rbx, %r14
sete %al
jmp 0xc5a9e
cmpb $0x1b, (%rbx)
jne 0xc5a9c
movq 0x28(%r14), %rax
movq 0x18(%rax), %rdx
movq 0x28(%rbx), %rax
cmpq 0x18(%rax), %rdx
jne 0xc5a9c
movb $0x1, %al
testq %rdx, %rdx
je 0xc5a9e
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xc5a9c
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xc5ab1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc4bdc
cmpb $0x13, (%rbx)
jne 0xc5a9c
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xc5a9c
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xc5a9c
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc3ebe
cmpb $0x1c, (%rbx)
jne 0xc5a9c
movq 0x28(%r12), %rax
cmpq 0x28(%r15), %rax
jne 0xc5a9c
cmpq 0x150(%r13), %r14
je 0xc5a4e
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xc5a6a
callq 0xc4be5
jmp 0xc5a6f
cmpb $0x14, (%rbx)
jne 0xc5a9c
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jne 0xc5a9c
movq 0x20(%r12), %rax
cmpq 0x20(%r15), %rax
jne 0xc5a9c
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xc5a5c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc48e2
movq 0x28(%r12), %rax
cmpq 0x28(%r15), %rax
jne 0xc5a9c
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
testb %r8b, %r8b
je 0xc5a14
callq 0xc4d96
jmp 0xc5a19
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc4481
callq 0xc41fa
testb %al, %al
je 0xc5a9c
cmpb $0x1, (%r14)
jne 0xc5a39
cmpb $0x1, (%rbx)
jne 0xc5a39
cmpq 0x10(%r12), %r14
je 0xc5aa8
movq 0x10(%r14), %r14
movq 0x10(%rbx), %rbx
jmp 0xc5a1d
movq 0x110(%r13), %rax
xorq %rax, %r14
xorq %rax, %rbx
orq %r14, %rbx
jmp 0xc58be
movq 0x18(%r12), %rax
cmpq 0x18(%r15), %rax
jmp 0xc58be
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc3ee5
callq 0xc41ea
testb %al, %al
je 0xc5a9c
addq $0x8, %r14
addq $0x8, %rbx
movq (%rbx), %rbx
movq (%r14), %r14
testq %r14, %r14
je 0xc5abf
testq %rbx, %rbx
je 0xc5abf
cmpq 0x18(%r12), %r14
je 0xc5ac7
addq $0x18, %r14
addq $0x18, %rbx
jmp 0xc5a7b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpq 0x10(%r15), %rbx
jmp 0xc58be
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xc41e2
orq %rbx, %r14
jmp 0xc58be
cmpq 0x18(%r15), %rbx
jmp 0xc58be