// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: vector_equivalent
static bool vector_equivalent(s7_scheme *sc, s7_pointer x, s7_pointer y, shared_info *ci)
                {
                    s7_int i, len;
                    shared_info *nci = ci;

                    if (x == y)
                        return(true);
                    if (!is_any_vector(y))
                    {
                        check_equivalent_method(sc, y, x);
                        return(false);
                    }
                    len = vector_length(x);
                    if (len != vector_length(y)) return(false);
                    if (len == 0) return(true);
                    if (!vector_rank_match(sc, x, y)) return(false);

                    if (type(x) != type(y))
                    {
                        /* (equivalent? (make-int-vector 3 0) (make-vector 3 0)) -> #t
                         * (equivalent? (make-float-vector 3 1.0) (vector 1 1 1)) -> #t
                         */
                        if ((is_int_vector(x)) && (is_byte_vector(y)))
                            return(biv_meq(sc, y, x, NULL));
                        if ((is_byte_vector(x)) && (is_int_vector(y)))
                            return(biv_meq(sc, x, y, NULL));
                        for (i = 0; i < len; i++)
                            if (!s7_is_equivalent_1(sc, vector_getter(x)(sc, x, i), vector_getter(y)(sc, y, i), NULL)) /* this could be greatly optimized */
                                return(false);
                        return(true);
                    }

                    if (is_float_vector(x))
                    {
                        s7_double *arr1, *arr2;
                        s7_double fudge;
                        arr1 = float_vector_floats(x);
                        arr2 = float_vector_floats(y);
                        fudge = sc->equivalent_float_epsilon;
                        if (fudge == 0.0)
                        {
                            for (i = 0; i < len; i++)
                                if ((arr1[i] != arr2[i]) &&
                                        ((!is_NaN(arr1[i])) || (!is_NaN(arr2[i]))))
                                    return(false);
                        }
                        else
                        {
                            for (i = 0; i < len; i++)
                                if (!floats_are_equivalent(sc, arr1[i], arr2[i]))
                                    return(false);
                        }
                        return(true);
                    }
                    if (is_int_vector(x))
                        return(iv_meq(int_vector_ints(x), int_vector_ints(y), len));
                    if (is_byte_vector(x))
                        return(byte_vector_equal(sc, x, y, NULL));

                    if (!has_simple_elements(x))
                    {
                        if (ci)
                            equal_ref(sc, x, y, ci);
                        else nci = new_shared_info(sc);
                    }
                    for (i = 0; i < len; i++)
                        if (!(s7_is_equivalent_1(sc, vector_element(x, i), vector_element(y, i), nci)))
                            return(false);
                    return(true);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rdx, %rsi
je 0x1008fb
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movzbl (%rdx), %r14d
leaq 0x523f0(%rip), %rax     # 0x152c20
cmpb $0x0, (%r14,%rax)
je 0x100902
movq 0x8(%r12), %rax
movq 0x8(%r15), %rbp
cmpq %rbp, %rax
jne 0x1009c8
testq %rax, %rax
je 0x1008fb
movq %rcx, %r13
movq %rax, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x101b15
testb %al, %al
je 0x1009c8
movzbl (%r12), %eax
cmpb %r14b, %al
jne 0x1009db
cmpl $0x16, %eax
movq (%rsp), %r8
je 0x100a79
cmpl $0x18, %eax
je 0x100a60
cmpl $0x17, %eax
jne 0x100b01
movq 0x10(%r12), %r12
movq 0x10(%r15), %r15
movsd 0x260(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x100b40
jp 0x100b40
testq %r8, %r8
jle 0x1008fb
xorl %ecx, %ecx
xorl %eax, %eax
movsd (%r12,%rcx,8), %xmm1
movsd (%r15,%rcx,8), %xmm0
ucomisd %xmm0, %xmm1
jne 0x1008df
jnp 0x1008f3
ucomisd %xmm1, %xmm1
jnp 0x1009ca
ucomisd %xmm0, %xmm0
jnp 0x1009ca
incq %rcx
cmpq %rcx, %r8
jne 0x1008cb
movb $0x1, %al
jmp 0x1009ca
testb $0x40, 0x3(%r15)
je 0x1009c8
cmpb $0x1, 0x24c(%rbx)
jne 0x1009c8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9a55
movq 0x1100(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
movq %rax, %r14
movq 0x128(%rbx), %r13
cmpq %r13, %rax
je 0x1009c3
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %rbp
cmpq 0x98(%rbx), %rax
ja 0x100965
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r15, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbd41
cmpq %rax, 0x120(%rbx)
setne %al
jmp 0x1009c3
cmpq %r13, %r14
jne 0x1009ca
xorl %eax, %eax
andb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ecx
xorb $0x16, %cl
movl %r14d, %edx
xorb $0x18, %dl
orb %cl, %dl
movq (%rsp), %r8
jne 0x100a1e
movb $0x1, %al
testq %rbp, %rbp
jle 0x1009ca
movq 0x10(%r15), %rcx
movq 0x10(%r12), %rdx
decq %rbp
xorl %esi, %esi
movzbl (%rcx,%rsi), %eax
cmpq %rax, (%rdx,%rsi,8)
sete %al
jne 0x1009ca
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rbp
movq %rdi, %rsi
jne 0x100a03
jmp 0x1009ca
xorb $0x18, %al
xorb $0x16, %r14b
orb %al, %r14b
jne 0x100a98
movb $0x1, %al
testq %r8, %r8
jle 0x1009ca
movq 0x10(%r12), %rcx
movq 0x10(%r15), %rdx
decq %r8
xorl %esi, %esi
movzbl (%rcx,%rsi), %eax
cmpq %rax, (%rdx,%rsi,8)
sete %al
jne 0x1009ca
leaq 0x1(%rsi), %rdi
cmpq %rsi, %r8
movq %rdi, %rsi
jne 0x100a3e
jmp 0x1009ca
movq %r12, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x101c28
movq 0x10(%r12), %rdi
movq 0x10(%r15), %rsi
movq %r8, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x101b85
movb $0x1, %al
testq %r8, %r8
jle 0x1009ca
decq %r8
xorl %r13d, %r13d
movq %r8, %r14
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *0x20(%r12)
movq %rax, %rbp
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x20(%r15)
movzbl (%rbp), %r8d
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
leaq 0x5a3df(%rip), %rax     # 0x15aec0
callq *(%rax,%r8,8)
testb %al, %al
je 0x1009ca
leaq 0x1(%r13), %rcx
movq %r14, %r8
cmpq %r13, %r14
movq %rcx, %r13
jne 0x100aa9
jmp 0x1009ca
testb $0x1, 0x7(%r12)
jne 0x100c78
testq %r13, %r13
je 0x100b84
xorl %edx, %edx
testb $0x2, 0x2(%r15)
je 0x100b9f
movslq 0xc(%r13), %rax
testq %rax, %rax
jle 0x100b9f
movq (%r13), %rdx
xorl %ecx, %ecx
cmpq %r15, (%rdx,%rcx,8)
je 0x100b98
incq %rcx
cmpq %rcx, %rax
jne 0x100b2e
xorl %edx, %edx
jmp 0x100b9f
movb $0x1, %al
testq %r8, %r8
jle 0x1009ca
decq %r8
xorl %r14d, %r14d
movq %r8, %r13
movsd (%r12,%r14,8), %xmm0
movsd (%r15,%r14,8), %xmm1
movq %rbx, %rdi
callq 0x101c6c
testb %al, %al
je 0x1009ca
leaq 0x1(%r14), %rcx
movq %r13, %r8
cmpq %r14, %r13
movq %rcx, %r14
jne 0x100b51
jmp 0x1009ca
movq %rbx, %rdi
callq 0x9c66c
movq (%rsp), %r8
movq %rax, %r13
jmp 0x100c78
movq 0x20(%r13), %rax
movl (%rax,%rcx,4), %edx
testb $0x2, 0x2(%r12)
jne 0x100bbb
testl %edx, %edx
je 0x100bdc
movq %r13, %rdi
movq %r12, %rsi
callq 0x100fa2
jmp 0x100c3b
movslq 0xc(%r13), %rax
testq %rax, %rax
jle 0x100bd8
movq (%r13), %rsi
xorl %ecx, %ecx
cmpq %r12, (%rsi,%rcx,8)
je 0x100c44
incq %rcx
cmpq %rcx, %rax
jne 0x100bca
xorl %eax, %eax
jmp 0x100c4b
movl 0xc(%r13), %eax
cmpl 0x14(%r13), %eax
jl 0x100bee
movq %r13, %rdi
callq 0x9cf49
orb $0x2, 0x2(%r12)
orb $0x2, 0x2(%r15)
movq (%r13), %rax
movslq 0xc(%r13), %rcx
movq %r12, (%rax,%rcx,8)
movl 0x10(%r13), %eax
incl %eax
movl %eax, 0x10(%r13)
movq 0x20(%r13), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0xc(%r13)
movl %eax, (%rdx,%rcx,4)
movq (%r13), %rax
movslq 0xc(%r13), %rcx
movq %r15, (%rax,%rcx,8)
movl 0x10(%r13), %eax
movq 0x20(%r13), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0xc(%r13)
movl %eax, (%rdx,%rcx,4)
movb $0x1, %bpl
movq (%rsp), %r8
jmp 0x100c6f
movq 0x20(%r13), %rax
movl (%rax,%rcx,4), %eax
testl %edx, %edx
sete %bpl
je 0x100c5a
cmpl %edx, %eax
sete %al
jmp 0x100c6f
testl %eax, %eax
je 0x100c6f
movq %r13, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x100fa2
movq (%rsp), %r8
testb %bpl, %bpl
je 0x1009ca
movb $0x1, %al
testq %r8, %r8
jle 0x1009ca
decq %r8
xorl %r14d, %r14d
movq %r8, %rbp
movq 0x10(%r12), %rax
movq (%rax,%r14,8), %rsi
movq 0x10(%r15), %rax
movq (%rax,%r14,8), %rdx
movzbl (%rsi), %eax
movq %rbx, %rdi
movq %r13, %rcx
leaq 0x5a213(%rip), %r8      # 0x15aec0
callq *(%r8,%rax,8)
testb %al, %al
je 0x1009ca
leaq 0x1(%r14), %rcx
movq %rbp, %r8
cmpq %r14, %rbp
movq %rcx, %r14
jne 0x100c89
jmp 0x1009ca