// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: copy_direct
static s7_pointer copy_direct(s7_scheme *sc, s7_pointer dest, s7_pointer source, s7_int dest_start, s7_int dest_end, s7_int source_start)
                {
                    /* types equal, but not a let (handled in s7_copy_1), returns NULL if not copied here */
                    s7_int i, j, source_len;
                    source_len = dest_end - dest_start;
                    switch (type(source))
                    {
                        case T_PAIR:
                            {
                                s7_pointer pd, ps;
                                for (ps = source, i = 0; i < source_start; i++)
                                    ps = cdr(ps);
                                for (pd = dest, i = 0; i < dest_start; i++)
                                    pd = cdr(pd);
                                for (; (i < dest_end) && is_pair(ps) && is_pair(pd); i++, ps = cdr(ps), pd = cdr(pd))
                                    set_car(pd, car(ps));
                                return(dest);
                            }

                        case T_VECTOR:
                            if (is_typed_vector(dest))
                            {
                                s7_pointer *els;
                                els = vector_elements(source);
                                for (i = source_start, j = dest_start; j < dest_end; i++, j++)
                                    typed_vector_setter(sc, dest, j, els[i]);                     /* types are equal, so source is a normal vector */
                            }
                            else memcpy((void *)((vector_elements(dest)) + dest_start), (void *)((vector_elements(source)) + source_start), source_len * sizeof(s7_pointer));
                            return(dest);

                        case T_INT_VECTOR:
                            memcpy((void *)((int_vector_ints(dest)) + dest_start), (void *)((int_vector_ints(source)) + source_start), source_len * sizeof(s7_int));
                            return(dest);

                        case T_FLOAT_VECTOR:
                            memcpy((void *)((float_vector_floats(dest)) + dest_start), (void *)((float_vector_floats(source)) + source_start), source_len * sizeof(s7_double));
                            return(dest);

                        case T_BYTE_VECTOR:
                            if (is_string(dest))
                                memcpy((void *)(string_value(dest) + dest_start), (void *)((byte_vector_bytes(source)) + source_start), source_len * sizeof(uint8_t));
                            else memcpy((void *)(byte_vector_bytes(dest) + dest_start), (void *)((byte_vector_bytes(source)) + source_start), source_len * sizeof(uint8_t));
                            return(dest);

                        case T_STRING:
                            if (is_string(dest))
                                memcpy((void *)(string_value(dest) + dest_start), (void *)((string_value(source)) + source_start), source_len);
                            else memcpy((void *)(byte_vector_bytes(dest) + dest_start), (void *)((string_value(source)) + source_start), source_len);
                            return(dest);

                        case T_C_OBJECT:
                            {
                                s7_pointer mi, mj;
                                s7_int gc_loc1, gc_loc2;
                                s7_pointer (*cref)(s7_scheme *sc, s7_pointer args);
                                s7_pointer (*cset)(s7_scheme *sc, s7_pointer args);

                                mi = make_mutable_integer(sc, 0);
                                mj = make_mutable_integer(sc, 0);
                                gc_loc1 = s7_gc_protect_1(sc, mi);
                                gc_loc2 = s7_gc_protect_1(sc, mj);
                                cref = c_object_ref(sc, source);
                                cset = c_object_set(sc, dest);

                                for (i = source_start, j = dest_start; i < dest_end; i++, j++)
                                {
                                    integer(mi) = i;
                                    integer(mj) = j;
                                    set_car(sc->t2_1, source);
                                    set_car(sc->t2_2, mi);
                                    set_car(sc->t3_3, cref(sc, sc->t2_1));
                                    set_car(sc->t3_1, dest);
                                    set_car(sc->t3_2, mj);
                                    cset(sc, sc->t3_1);
                                }
                                s7_gc_unprotect_at(sc, gc_loc1);
                                s7_gc_unprotect_at(sc, gc_loc2);
                                free_cell(sc, mi);
                                free_cell(sc, mj);
                                return(dest);
                            }

                        case T_LET:
                            return(NULL);

                        case T_HASH_TABLE:
                            {
                                s7_pointer p;
                                p = hash_table_copy(sc, source, dest, source_start, source_start + source_len);
                                if ((hash_table_checker(source) != hash_table_checker(dest)) &&
                                        (!hash_table_checker_locked(dest)))
                                {
                                    if (hash_table_checker(dest) == hash_empty)
                                        hash_table_checker(dest) = hash_table_checker(source);
                                    else
                                    {
                                        hash_table_checker(dest) = hash_equal;
                                        hash_set_chosen(dest);
                                    }
                                }
                                return(p);
                            }

                        default:
                            return(dest);
                    }
                    return(NULL);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
movzbl (%rdx), %ecx
leal -0x13(%rcx), %eax
cmpl $0x9, %eax
ja 0x7bd72
movq %rdi, %rbp
movq %r12, %r8
subq %r15, %r8
leaq 0x585ac(%rip), %rcx     # 0xd4308
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq 0x10(%rbx), %r15
addq 0x10(%r14), %r13
jmp 0x7bf45
cmpl $0x1, %ecx
jne 0x7bf53
xorl %eax, %eax
testq %r13, %r13
cmovgq %r13, %rax
subq $0x1, %rax
jb 0x7bf65
movq 0x10(%r14), %r14
jmp 0x7bd84
xorl %ebx, %ebx
jmp 0x7bf53
addq %r13, %r8
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x7bfd3
movq 0x18(%r14), %rax
movq 0x18(%rbx), %rcx
cmpq %rcx, %rax
je 0x7bf53
leaq 0x9dea9(%rip), %rdx     # 0x119c70
cmpq %rdx, 0x20(%rbx)
jne 0x7bf53
leaq -0x4be7d(%rip), %rdx    # 0x2ff5b
cmpq %rdx, %rcx
je 0x7bfcd
leaq -0x4b8e1(%rip), %rax    # 0x30507
movq %rax, 0x18(%rbx)
orb $0x20, 0x3(%rbx)
jmp 0x7bf53
movq %r12, 0x30(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
callq 0x7c936
movq %rbx, 0x8(%rsp)
movq %rax, %rbx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x7c936
movq %rax, %r12
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x89a9
movq %rax, 0x18(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x89a9
movq %rax, 0x10(%rsp)
movq 0x8d8(%rbp), %rax
movq 0x8(%r14), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq 0x30(%rsp), %r13
jge 0x7bed7
movq %r13, 0x8(%rbx)
movq %r15, 0x8(%r12)
movq 0x570(%rbp), %rax
movq %r14, 0x8(%rax)
movq 0x578(%rbp), %rax
movq %rbx, 0x8(%rax)
movq 0x570(%rbp), %rsi
movq %rbp, %rdi
callq *0x28(%rsp)
movq 0x590(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq 0x580(%rbp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x588(%rbp), %rax
movq %r12, 0x8(%rax)
movq 0x580(%rbp), %rsi
movq %rbp, %rdi
callq *0x20(%rsp)
incq %r13
incq %r15
jmp 0x7be67
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
callq 0x8b00
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x8b00
andq $0x0, (%rbx)
movq 0x90(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x90(%rbp)
movq %rbx, (%rax)
andq $0x0, (%r12)
movq 0x90(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x90(%rbp)
movq %r12, (%rax)
movq 0x8(%rsp), %rbx
jmp 0x7bf53
testb $0x2, 0x6(%rbx)
jne 0x7bfa5
shlq $0x3, %r15
addq 0x10(%rbx), %r15
shlq $0x3, %r13
addq 0x10(%r14), %r13
shlq $0x3, %r8
movq %r15, %rdi
movq %r13, %rsi
movq %r8, %rdx
callq 0x83e0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
testq %r15, %r15
cmovgq %r15, %rax
movq %rax, %rdx
movq %rbx, %rcx
subq $0x1, %rdx
jb 0x7bf9e
movq 0x10(%rcx), %rcx
jmp 0x7bf74
cmpb $0x1, (%r14)
jne 0x7bf53
cmpb $0x1, (%rcx)
jne 0x7bf53
movq 0x8(%r14), %rdx
movq %rdx, 0x8(%rcx)
incq %rax
movq 0x10(%r14), %r14
movq 0x10(%rcx), %rcx
cmpq %r12, %rax
jl 0x7bf80
jmp 0x7bf53
shlq $0x3, %r13
addq 0x10(%r14), %r13
cmpq %r12, %r15
jge 0x7bf53
movq (%r13), %rcx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2ecba
incq %r15
addq $0x8, %r13
jmp 0x7bfad
movq %rax, 0x18(%rbx)
jmp 0x7bf53