// File: /workspace/github_c_makefile_star2_O1/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 0xa1346
movq %rdi, %r12
movq %r8, %r9
subq %r14, %r9
leaq 0x6ff7c(%rip), %rcx     # 0x1112a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r8, (%rsp)
jmpq *%rax
addq 0x10(%r15), %r14
addq 0x10(%r13), %rbp
jmp 0xa1856
cmpl $0x1, %ecx
jne 0xa1864
testq %rbp, %rbp
jle 0xa135d
movq 0x10(%r13), %r13
decq %rbp
jne 0xa1354
testq %r14, %r14
jle 0xa1956
movq %r14, %rcx
movq %r15, %rax
movq 0x10(%rax), %rax
decq %rcx
jne 0xa136c
jmp 0xa195c
xorl %r15d, %r15d
jmp 0xa1864
addq %rbp, %r9
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r9, %r8
callq 0xa1c25
movq 0x18(%r13), %rax
movq 0x18(%r15), %rcx
cmpq %rcx, %rax
je 0xa1864
leaq 0xb18bf(%rip), %rdx     # 0x152c70
cmpq %rdx, 0x20(%r15)
jne 0xa1864
leaq -0x61f6e(%rip), %rdx    # 0x3f454
cmpq %rdx, %rcx
je 0xa1993
leaq -0x619c1(%rip), %rax    # 0x3fa11
movq %rax, 0x18(%r15)
orb $0x20, 0x3(%r15)
jmp 0xa1864
movq 0x90(%r12), %rax
cmpq 0x98(%r12), %rax
ja 0xa13fe
movq %r12, %rdi
callq 0xb389
movq (%rsp), %r8
movq %r15, 0x20(%rsp)
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 0xa1452
movq %r12, %rdi
callq 0xb389
movq 0x10(%rsp), %r9
movq (%rsp), %r8
movq 0x90(%r12), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq -0x8(%rax), %rdi
movq $0x500000b, (%rdi)      # imm = 0x500000B
movq $0x0, 0x8(%rdi)
cmpq $0x0, 0x108(%r12)
movq %rdi, 0x18(%rsp)
jns 0xa1561
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 0xae0f
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 0x9510
movq 0x10(%rsp), %r9
movq (%rsp), %r8
movq %rax, 0xe8(%r12)
cmpq %r15, %rbx
movq 0x18(%rsp), %rdi
jge 0xa1561
movq %rbx, %rax
movq 0xd0(%r12), %rcx
movq 0x140(%r12), %rdx
movq 0x10(%rcx), %rcx
movq %rdx, (%rcx,%rax,8)
movq 0xe8(%r12), %rcx
movq 0x108(%r12), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x108(%r12)
movq %rax, 0x8(%rcx,%rdx,8)
incq %rax
decq %rbx
jne 0xa1520
movq 0xd0(%r12), %rax
movq 0xe8(%r12), %rcx
movq 0x108(%r12), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x108(%r12)
movq (%rcx,%rdx,8), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x30(%rsp)
movq %r9, (%rax,%rcx,8)
testq %rdx, %rdx
jg 0xa1673
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 0xae0f
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 0x9510
movq 0x10(%rsp), %r9
movq (%rsp), %r8
movq %rax, 0xe8(%r12)
cmpq %r15, %rbx
movq 0x18(%rsp), %rdi
jge 0xa1673
movq %rbx, %rax
movq 0xd0(%r12), %rcx
movq 0x140(%r12), %rdx
movq 0x10(%rcx), %rcx
movq %rdx, (%rcx,%rax,8)
movq 0xe8(%r12), %rcx
movq 0x108(%r12), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x108(%r12)
movq %rax, 0x8(%rcx,%rdx,8)
incq %rax
decq %rbx
jne 0xa1632
movq 0xd0(%r12), %rax
movq 0xe8(%r12), %rcx
movq 0x108(%r12), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x108(%r12)
movq (%rcx,%rdx,8), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x28(%rsp)
movq %rdi, (%rax,%rcx,8)
cmpq %r8, %rbp
jge 0xa1755
movq %rdi, %rbx
movq 0x8d8(%r12), %rax
movq 0x8(%r13), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0x8(%rsp)
movq 0x20(%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 0x20(%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 0xa16de
movq 0x30(%rsp), %r8
cmpq %r8, 0xf0(%r12)
movq 0x20(%rsp), %r15
jle 0xa17ac
movq 0xd0(%r12), %rax
movq 0x140(%r12), %rcx
movq 0x10(%rax), %rdx
cmpq %rcx, (%rdx,%r8,8)
je 0xa17a4
movq 0xe8(%r12), %rdx
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %r8, 0x8(%rdx,%rsi,8)
movq 0x10(%rax), %rax
movq %rcx, (%rax,%r8,8)
movq 0x28(%rsp), %r8
cmpq %r8, 0xf0(%r12)
jle 0xa17fe
movq 0xd0(%r12), %rax
movq 0x140(%r12), %rcx
movq 0x10(%rax), %rdx
cmpq %rcx, (%rdx,%r8,8)
je 0xa17f6
movq 0xe8(%r12), %rdx
movq 0x108(%r12), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%r12)
movq %r8, 0x8(%rdx,%rsi,8)
movq 0x10(%rax), %rax
movq %rcx, (%rax,%r8,8)
xorl %eax, %eax
movq %rax, (%r9)
movq 0x90(%r12), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x90(%r12)
movq %r9, (%rcx)
movq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq 0x90(%r12), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq %rdx, (%rax)
jmp 0xa1864
testb $0x2, 0x6(%r15)
jne 0xa1876
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 0x93e0
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r14, %r8
jle 0xa1864
movq 0x10(%r13), %rax
leaq (%rax,%rbp,8), %rbx
leaq 0x7a1be(%rip), %r13     # 0x11ba48
movq (%rbx), %rbp
cmpq $0x0, 0x6a0(%r12)
js 0xa18ea
movq 0x28(%r15), %rsi
cmpb $0x30, (%rsi)
jb 0xa18c0
movq 0x10(%rsi), %rax
movq 0x700(%r12), %rcx
movq %rbp, 0x8(%rcx)
movq 0x700(%r12), %rsi
movq %r12, %rdi
callq *%rax
jmp 0xa18dc
movq 0x700(%r12), %rax
movq %rbp, 0x8(%rax)
movq 0x700(%r12), %rdx
movq %r12, %rdi
callq 0xbd41
cmpq 0x120(%r12), %rax
movq (%rsp), %r8
je 0xa18f4
movq 0x10(%r15), %rax
movq %rbp, (%rax,%r14,8)
jmp 0xa1941
movq 0x28(%r15), %rsi
cmpb $0x30, (%rsi)
jb 0xa1903
movq 0x8(%rsi), %rax
jmp 0xa1917
movq 0x18(%rsi), %rdx
movq %r12, %rdi
callq 0xa05a7
movq 0x8(%rax), %rax
addq $0x10, %rax
movq (%rax), %rsi
movq %r12, %rdi
movl $0x1, %edx
callq 0xa0491
movl $0x3, %edx
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rcx
movq %rax, %r8
callq 0xe25f
movq (%rsp), %r8
incq %r14
addq $0x8, %rbx
cmpq %r14, %r8
jne 0xa188a
jmp 0xa1864
xorl %r14d, %r14d
movq %r15, %rax
subq %r14, %r8
jle 0xa1864
cmpb $0x1, (%r13)
jne 0xa1864
cmpb $0x1, (%rax)
jne 0xa1864
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r13), %r13
movq 0x10(%rax), %rax
decq %r8
jne 0xa1965
jmp 0xa1864
movq %rax, 0x18(%r15)
jmp 0xa1864