// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: s7_vector_copy
s7_pointer s7_vector_copy(s7_scheme *sc, s7_pointer old_vect)
#endif
                    {
                        s7_int i, len;
                        s7_pointer new_vect;

                        len = vector_length(old_vect);
                        if (is_normal_vector(old_vect))
                        {
                            s7_pointer *src, *dst;
                            if ((is_typed_vector(old_vect)) && (len > 0)) /* preserve the type info as well */
                            {
                                if (vector_rank(old_vect) > 1)
                                    new_vect = g_make_vector(sc, set_plist_3(sc, g_vector_dimensions(sc, list_1(sc, old_vect)), vector_element(old_vect, 0), typed_vector_typer(old_vect)));
                                else new_vect = g_make_vector(sc, set_plist_3(sc, make_integer(sc, len), vector_element(old_vect, 0), typed_vector_typer(old_vect)));
                            }
                            else
                            {
                                if (vector_rank(old_vect) > 1)
                                    new_vect = g_make_vector(sc, set_plist_1(sc, g_vector_dimensions(sc, list_1(sc, old_vect))));
                                else new_vect = make_simple_vector(sc, len);
                            }
                            /* here and in vector-fill! we have a problem with bignums -- should new bignums be allocated? (copy_list also) */
                            src = (s7_pointer *)vector_elements(old_vect);
                            dst = (s7_pointer *)vector_elements(new_vect);
                            for (i = len; i > 0; i--) *dst++ = *src++;
                            return(new_vect);
                        }

                        if (is_float_vector(old_vect))
                        {
                            s7_double *src, *dst;
                            if (vector_rank(old_vect) > 1)
                                new_vect = g_make_vector_1(sc, set_plist_2(sc, g_vector_dimensions(sc, set_plist_1(sc, old_vect)), real_zero), sc->make_float_vector_symbol);
                            else new_vect = make_simple_float_vector(sc, len);
                            src = (s7_double *)float_vector_floats(old_vect);
                            dst = (s7_double *)float_vector_floats(new_vect);
                            for (i = len; i > 0; i--) *dst++ = *src++;  /* same speed as memcpy(dst, src, len * sizeof(s7_double)); */
                            return(new_vect);
                        }

                        if (is_int_vector(old_vect))
                        {
                            s7_int *src, *dst;
                            if (vector_rank(old_vect) > 1)
                                new_vect = g_make_vector_1(sc, set_plist_2(sc, g_vector_dimensions(sc, set_plist_1(sc, old_vect)), small_int(0)), sc->make_int_vector_symbol);
                            else new_vect = make_simple_int_vector(sc, len);
                            src = (s7_int *)int_vector_ints(old_vect);
                            dst = (s7_int *)int_vector_ints(new_vect);
                            for (i = len; i > 0; i--) *dst++ = *src++;
                            return(new_vect);
                        }

                        if (is_byte_vector(old_vect))
                        {
                            uint8_t *src, *dst;
                            if (vector_rank(old_vect) > 1)
                                new_vect = g_make_vector_1(sc, set_plist_2(sc, g_vector_dimensions(sc, set_plist_1(sc, old_vect)), small_int(0)), sc->make_byte_vector_symbol);
                            else new_vect = make_simple_byte_vector(sc, len);
                            src = (uint8_t *)byte_vector_bytes(old_vect);
                            dst = (uint8_t *)byte_vector_bytes(new_vect);
                            for (i = len; i > 0; i--) *dst++ = *src++;
                            return(new_vect);
                        }
                        return(NULL);
                    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movzbl (%rsi), %eax
addl $-0x15, %eax
cmpl $0x3, %eax
ja 0x3e5a4
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rsi), %rbx
leaq 0xd1f7d(%rip), %rcx     # 0x110344
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x6(%r14), %al
shrb %al
testq %rbx, %rbx
setg %cl
andb %al, %cl
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
cmpb $0x1, %cl
jne 0x3e69c
testq %rax, %rax
je 0x3e713
cmpq $0x2, 0x10(%rax)
jl 0x3e713
movq 0x90(%r15), %rax
movq 0x110(%r15), %r12
cmpq 0x98(%r15), %rax
ja 0x3e422
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rsi
movq $0x200001, (%rsi)       # imm = 0x200001
movq %r14, 0x8(%rsi)
movq %r12, 0x10(%rsi)
movq %r15, %rdi
callq 0x3eb16
jmp 0x3e9c6
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3e5ac
cmpq $0x2, 0x10(%rax)
jl 0x3e5ac
movq 0x700(%r15), %rax
movq %r14, 0x8(%rax)
movq 0x700(%r15), %rsi
movq %r15, %rdi
callq 0x3eb16
movq 0x1147c7(%rip), %rcx    # 0x152c58
movq 0x708(%r15), %rdx
movq %rax, 0x8(%rdx)
movq 0x710(%r15), %rax
movq %rcx, 0x8(%rax)
movq 0x708(%r15), %rsi
movq 0x12d8(%r15), %rdx
movq %r15, %rdi
callq 0x3ed20
movq %rax, %r12
jmp 0x3e859
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3e605
cmpq $0x2, 0x10(%rax)
jl 0x3e605
movq 0x700(%r15), %rax
movq %r14, 0x8(%rax)
movq 0x700(%r15), %rsi
movq %r15, %rdi
callq 0x3eb16
movq 0x11044e(%rip), %rcx    # 0x14e950
movq 0x708(%r15), %rdx
movq %rax, 0x8(%rdx)
movq 0x710(%r15), %rax
movq %rcx, 0x8(%rax)
movq 0x708(%r15), %rsi
movq 0x12d0(%r15), %rdx
movq %r15, %rdi
callq 0x3ed20
jmp 0x3e610
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3e643
cmpq $0x2, 0x10(%rax)
jl 0x3e643
movq 0x700(%r15), %rax
movq %r14, 0x8(%rax)
movq 0x700(%r15), %rsi
movq %r15, %rdi
callq 0x3eb16
movq 0x1103e0(%rip), %rcx    # 0x14e950
movq 0x708(%r15), %rdx
movq %rax, 0x8(%rdx)
movq 0x710(%r15), %rax
movq %rcx, 0x8(%rax)
movq 0x708(%r15), %rsi
movq 0x12f0(%r15), %rdx
movq %r15, %rdi
callq 0x3ed20
movq %rax, %r12
jmp 0x3e95c
xorl %r12d, %r12d
jmp 0x3eafb
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x3e5c4
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %r12
movq $0x200017, (%r12)       # imm = 0x200017
movq %rbx, 0x8(%r12)
leaq (,%rbx,8), %rsi
testq %rsi, %rsi
jle 0x3e789
movq %r15, %rdi
callq 0xa305
jmp 0x3e7f1
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3f2f5
movq %rax, %r12
testq %rbx, %rbx
jle 0x3eafb
movq 0x10(%r12), %rax
movq 0x10(%r14), %rcx
incq %rbx
xorl %edx, %edx
movb (%rcx,%rdx), %sil
movb %sil, (%rax,%rdx)
incq %rdx
decq %rbx
cmpq $0x1, %rbx
jg 0x3e62a
jmp 0x3eafb
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x3e65b
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %r12
movq $0x200016, (%r12)       # imm = 0x200016
movq %rbx, 0x8(%r12)
leaq (,%rbx,8), %rsi
testq %rsi, %rsi
jle 0x3e88c
movq %r15, %rdi
callq 0xa305
jmp 0x3e8f4
testq %rax, %rax
je 0x3e730
cmpq $0x2, 0x10(%rax)
jl 0x3e730
movq 0x90(%r15), %rax
movq 0x110(%r15), %r12
cmpq 0x98(%r15), %rax
ja 0x3e6cf
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rsi
movq $0x200001, (%rsi)       # imm = 0x200001
movq %r14, 0x8(%rsi)
movq %r12, 0x10(%rsi)
movq %r15, %rdi
callq 0x3eb16
movq 0x700(%r15), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%r15), %rsi
jmp 0x3e9ec
cmpq $0x7ff, %rbx            # imm = 0x7FF
ja 0x3e98d
leaq 0x110229(%rip), %rax    # 0x14e950
movq (%rax,%rbx,8), %rax
jmp 0x3e9c6
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x3e748
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %r12
movq $0x200015, (%r12)       # imm = 0x200015
movq %rbx, 0x8(%r12)
leaq (,%rbx,8), %rsi
testq %rsi, %rsi
jle 0x3ea03
movq %r15, %rdi
callq 0xa305
jmp 0x3ea6b
cmpq $0x0, 0x838(%r15)
jne 0x3e7cf
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%r15)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x3e7ad
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%r15), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x838(%r15)
movl $0x0, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x20(%rax)
movq %rax, 0x18(%r12)
movq (%rax), %rcx
movq %rcx, 0x10(%r12)
movq $0x0, 0x20(%rax)
leaq -0x122d(%rip), %rax     # 0x3d5e0
movq %rax, 0x20(%r12)
leaq -0x11dc(%rip), %rax     # 0x3d63d
movq %rax, 0x28(%r12)
movq 0x740(%r15), %r15
movq 0x8(%r15), %rsi
cmpq %rsi, 0x10(%r15)
jne 0x3e846
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x9510
movq %rax, (%r15)
movq (%r15), %rax
movq 0x10(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r15)
movq %r12, (%rax,%rcx,8)
testq %rbx, %rbx
jle 0x3eafb
movq 0x10(%r12), %rax
movq 0x10(%r14), %rcx
incq %rbx
xorl %edx, %edx
movsd (%rcx,%rdx), %xmm0
movsd %xmm0, (%rax,%rdx)
addq $0x8, %rdx
decq %rbx
cmpq $0x1, %rbx
jg 0x3e870
jmp 0x3eafb
cmpq $0x0, 0x838(%r15)
jne 0x3e8d2
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%r15)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x3e8b0
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%r15), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x838(%r15)
movl $0x0, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x20(%rax)
movq %rax, 0x18(%r12)
movq (%rax), %rcx
movq %rcx, 0x10(%r12)
movq $0x0, 0x20(%rax)
leaq 0x617f1(%rip), %rax     # 0xa0101
movq %rax, 0x20(%r12)
leaq 0x6184b(%rip), %rax     # 0xa0167
movq %rax, 0x28(%r12)
movq 0x740(%r15), %r15
movq 0x8(%r15), %rsi
cmpq %rsi, 0x10(%r15)
jne 0x3e949
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x9510
movq %rax, (%r15)
movq (%r15), %rax
movq 0x10(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r15)
movq %r12, (%rax,%rcx,8)
testq %rbx, %rbx
jle 0x3eafb
movq 0x10(%r12), %rax
movq 0x10(%r14), %rcx
incq %rbx
xorl %edx, %edx
movq (%rcx,%rdx), %rsi
movq %rsi, (%rax,%rdx)
addq $0x8, %rdx
decq %rbx
cmpq $0x1, %rbx
jg 0x3e973
jmp 0x3eafb
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x3e9a5
movq %r15, %rdi
callq 0xb389
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rax
movq $0xb, (%rax)
movq %rbx, 0x8(%rax)
movq 0x10(%r14), %rcx
movq 0x28(%r14), %rdx
movq (%rcx), %rcx
movq 0x718(%r15), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1318(%r15), %rdx
movq %r15, %rdi
callq 0x3ed20
movq %rax, %r12
jmp 0x3ead3
cmpq $0x0, 0x838(%r15)
jne 0x3ea49
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%r15)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x3ea27
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%r15), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x838(%r15)
movl $0x0, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x20(%rax)
movq %rax, 0x18(%r12)
movq (%rax), %rcx
movq %rcx, 0x10(%r12)
movq $0x0, 0x20(%rax)
leaq 0x2289e(%rip), %rax     # 0x61325
movq %rax, 0x20(%r12)
leaq 0x2289b(%rip), %rax     # 0x6132e
movq %rax, 0x28(%r12)
movq 0x740(%r15), %r15
movq 0x8(%r15), %rsi
cmpq %rsi, 0x10(%r15)
jne 0x3eac0
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x9510
movq %rax, (%r15)
movq (%r15), %rax
movq 0x10(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r15)
movq %r12, (%rax,%rcx,8)
testq %rbx, %rbx
jle 0x3eafb
movq 0x10(%r12), %rax
movq 0x10(%r14), %rcx
incq %rbx
xorl %edx, %edx
movq (%rcx,%rdx), %rsi
movq %rsi, (%rax,%rdx)
decq %rbx
addq $0x8, %rdx
cmpq $0x1, %rbx
jg 0x3eae6
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq