// File: /workspace/github_c_makefile_star2_O3/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, %rbp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movzbl (%rdx), %ecx
leal -0x13(%rcx), %eax
cmpl $0x9, %eax
ja 0x9a982
movq %rdi, %r12
movq %r8, %r9
subq %r14, %r9
leaq 0x6d9ac(%rip), %rcx     # 0x108314
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r8, (%rsp)
jmpq *%rax
addq 0x10(%r15), %r14
addq 0x10(%r13), %rbp
jmp 0x9aaf3
cmpl $0x1, %ecx
jne 0x9ab01
testq %rbp, %rbp
jle 0x9a999
movq 0x10(%r13), %r13
decq %rbp
jne 0x9a990
testq %r14, %r14
jle 0x9afa7
movq %r14, %rcx
movq %r15, %rax
movq 0x10(%rax), %rax
decq %rcx
jne 0x9a9a8
jmp 0x9afad
xorl %r15d, %r15d
jmp 0x9ab01
addq %rbp, %r9
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r9, %r8
callq 0x9b257
movq 0x18(%r13), %rax
movq 0x18(%r15), %rcx
cmpq %rcx, %rax
je 0x9ab01
leaq 0xb0283(%rip), %rdx     # 0x14ac70
cmpq %rdx, 0x20(%r15)
jne 0x9ab01
leaq -0x5db91(%rip), %rdx    # 0x3ce6d
cmpq %rdx, %rcx
je 0x9afe4
leaq -0x5d5e4(%rip), %rax    # 0x3d42a
movq %rax, 0x18(%r15)
orb $0x20, 0x3(%r15)
jmp 0x9ab01
movq 0x90(%r12), %rax
cmpq 0x98(%r12), %rax
ja 0x9aa42
movq %r12, %rdi
callq 0xa550
movq (%rsp), %r8
movq 0x90(%r12), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq -0x8(%rax), %r9
movq $0x500000b, (%r9)       # imm = 0x500000B
movq $0x0, 0x8(%r9)
movq 0x90(%r12), %rax
cmpq 0x98(%r12), %rax
movq %r9, 0x10(%rsp)
ja 0x9aa91
movq %r12, %rdi
callq 0xa550
movq 0x10(%rsp), %r9
movq (%rsp), %r8
movq 0x90(%r12), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq -0x8(%rax), %rax
movq $0x500000b, (%rax)      # imm = 0x500000B
movq %rax, 0x20(%rsp)
movq $0x0, 0x8(%rax)
movq 0x108(%r12), %rcx
testq %rcx, %rcx
movq %r15, 0x18(%rsp)
js 0x9abf3
movq 0xe8(%r12), %rax
jmp 0x9acca
testb $0x2, 0x6(%r15)
jne 0x9ab13
shlq $0x3, %r14
addq 0x10(%r15), %r14
shlq $0x3, %rbp
addq 0x10(%r13), %rbp
shlq $0x3, %r9
movq %r14, %rdi
movq %rbp, %rsi
movq %r9, %rdx
callq 0x83e0
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r14, %r8
jle 0x9ab01
movq 0x10(%r13), %rax
leaq (%rax,%rbp,8), %rbx
leaq 0x78031(%rip), %r13     # 0x112b58
movq (%rbx), %rbp
cmpq $0x0, 0x6a0(%r12)
js 0x9ab87
movq 0x28(%r15), %rsi
cmpb $0x30, (%rsi)
jb 0x9ab5d
movq 0x10(%rsi), %rax
movq 0x700(%r12), %rcx
movq %rbp, 0x8(%rcx)
movq 0x700(%r12), %rsi
movq %r12, %rdi
callq *%rax
jmp 0x9ab79
movq 0x700(%r12), %rax
movq %rbp, 0x8(%rax)
movq 0x700(%r12), %rdx
movq %r12, %rdi
callq 0xaee6
cmpq 0x120(%r12), %rax
movq (%rsp), %r8
je 0x9ab91
movq 0x10(%r15), %rax
movq %rbp, (%rax,%r14,8)
jmp 0x9abde
movq 0x28(%r15), %rsi
cmpb $0x30, (%rsi)
jb 0x9aba0
movq 0x8(%rsi), %rax
jmp 0x9abb4
movq 0x18(%rsi), %rdx
movq %r12, %rdi
callq 0x99caa
movq 0x8(%rax), %rax
addq $0x10, %rax
movq (%rax), %rsi
movq %r12, %rdi
movl $0x1, %edx
callq 0x99bbf
movl $0x3, %edx
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rcx
movq %rax, %r8
callq 0xd4e5
movq (%rsp), %r8
incq %r14
addq $0x8, %rbx
cmpq %r14, %r8
jne 0x9ab27
jmp 0x9ab01
movq 0xd0(%r12), %rax
movq 0xf0(%r12), %rbx
leaq (%rbx,%rbx), %r15
movq 0x18(%rax), %rsi
movq %rbx, %rdx
shlq $0x4, %rdx
movq %rdx, 0x8(%rsp)
movq %r12, %rdi
callq 0x9fd6
movq $0x0, 0x20(%rax)
movq 0xd0(%r12), %rcx
movq %rax, 0x18(%rcx)
movq (%rax), %rax
movq 0xd0(%r12), %rcx
movq %rax, 0x10(%rcx)
movq 0xd0(%r12), %rax
movq %r15, 0x8(%rax)
movq %r15, 0xf0(%r12)
movq 0xe8(%r12), %rdi
movq 0x8(%rsp), %rsi
callq 0x8510
movq %rax, 0xe8(%r12)
cmpq %r15, %rbx
jge 0x9acb9
movq 0x140(%r12), %rcx
movq %rbx, %rdx
movq 0xd0(%r12), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax,%rdx,8)
movq 0xe8(%r12), %rax
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %rdx, 0x8(%rax,%rsi,8)
incq %rdx
decq %rbx
jne 0x9ac80
movq 0x108(%r12), %rcx
movq (%rsp), %r8
movq 0x10(%rsp), %r9
leaq -0x1(%rcx), %rdx
movq %rdx, 0x108(%r12)
movq (%rax,%rcx,8), %rdx
movq 0xd0(%r12), %rax
movq 0x10(%rax), %rax
movq %rdx, 0x30(%rsp)
movq %r9, (%rax,%rdx,8)
testq %rcx, %rcx
jle 0x9ad01
movq 0xe8(%r12), %rax
jmp 0x9add0
movq 0xd0(%r12), %rax
movq 0xf0(%r12), %rbx
leaq (%rbx,%rbx), %r15
movq 0x18(%rax), %rsi
movq %rbx, %rdx
shlq $0x4, %rdx
movq %rdx, 0x8(%rsp)
movq %r12, %rdi
callq 0x9fd6
movq $0x0, 0x20(%rax)
movq 0xd0(%r12), %rcx
movq %rax, 0x18(%rcx)
movq (%rax), %rax
movq 0xd0(%r12), %rcx
movq %rax, 0x10(%rcx)
movq 0xd0(%r12), %rax
movq %r15, 0x8(%rax)
movq %r15, 0xf0(%r12)
movq 0xe8(%r12), %rdi
movq 0x8(%rsp), %rsi
callq 0x8510
movq 0x10(%rsp), %r9
movq (%rsp), %r8
movq %rax, 0xe8(%r12)
cmpq %r15, %rbx
jge 0x9add0
movq 0x140(%r12), %rcx
movq %rbx, %rdx
movq 0xd0(%r12), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax,%rdx,8)
movq 0xe8(%r12), %rax
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %rdx, 0x8(%rax,%rsi,8)
incq %rdx
decq %rbx
jne 0x9ad97
movq 0xd0(%r12), %rcx
movq 0x108(%r12), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x108(%r12)
movq (%rax,%rdx,8), %rdx
movq 0x10(%rcx), %rax
movq 0x20(%rsp), %rbx
movq %rdx, 0x28(%rsp)
movq %rbx, (%rax,%rdx,8)
cmpq %r8, %rbp
jge 0x9aeac
movq 0x8d8(%r12), %rax
movq 0x8(%r13), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %r15
movq %rbp, 0x8(%r9)
movq %r14, 0x8(%rbx)
movq 0x570(%r12), %rax
movq %r13, 0x8(%rax)
movq 0x578(%r12), %rax
movq %r9, 0x8(%rax)
movq 0x570(%r12), %rsi
movq %r12, %rdi
callq *0x8(%rsp)
movq 0x590(%r12), %rcx
movq %rax, 0x8(%rcx)
movq 0x580(%r12), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x588(%r12), %rax
movq %rbx, 0x8(%rax)
movq 0x580(%r12), %rsi
movq %r12, %rdi
callq *%r15
movq 0x10(%rsp), %r9
incq %rbp
incq %r14
cmpq %rbp, (%rsp)
jne 0x9ae35
movq 0xf0(%r12), %rax
movq 0x30(%rsp), %r10
cmpq %r10, %rax
jle 0x9af15
movq 0xd0(%r12), %rdx
movq 0x140(%r12), %rcx
movq 0x10(%rdx), %rsi
cmpq %rcx, (%rsi,%r10,8)
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %r8
je 0x9af0f
movq 0xe8(%r12), %rax
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %r10, 0x8(%rax,%rsi,8)
movq 0x10(%rdx), %rsi
movq 0xf0(%r12), %rax
movq %rcx, (%rsi,%r10,8)
jmp 0x9af1f
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %r8
movq 0x28(%rsp), %r10
cmpq %r10, %rax
jle 0x9af6c
movq 0xd0(%r12), %rcx
movq 0x140(%r12), %rax
movq 0x10(%rcx), %rdx
cmpq %rax, (%rdx,%r10,8)
je 0x9af68
movq 0xe8(%r12), %rdx
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %r10, 0x8(%rdx,%rsi,8)
movq 0x10(%rcx), %rdx
movq %rax, (%rdx,%r10,8)
xorl %eax, %eax
movq %rax, (%r9)
movq 0x90(%r12), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x90(%r12)
movq %r9, (%rcx)
movq %rax, (%r8)
movq 0x90(%r12), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq %r8, (%rax)
jmp 0x9ab01
xorl %r14d, %r14d
movq %r15, %rax
subq %r14, %r8
jle 0x9ab01
cmpb $0x1, (%r13)
jne 0x9ab01
cmpb $0x1, (%rax)
jne 0x9ab01
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r13), %r13
movq 0x10(%rax), %rax
decq %r8
jne 0x9afb6
jmp 0x9ab01
movq %rax, 0x18(%r15)
jmp 0x9ab01