// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: object_to_list
static s7_pointer object_to_list(s7_scheme *sc, s7_pointer obj)
                {
                    /* used only in format_to_port_1 and (map values ...) */
                    switch (type(obj))
                    {
                        case T_INT_VECTOR:
                        case T_FLOAT_VECTOR:
                        case T_VECTOR:
                            return(s7_vector_to_list(sc, obj));

                        case T_STRING:
                            return(s7_string_to_list(sc, string_value(obj), string_length(obj)));

                        case T_BYTE_VECTOR:
                            return(byte_vector_to_list(sc, byte_vector_bytes(obj), byte_vector_length(obj)));

                        case T_HASH_TABLE:
                            if (hash_table_entries(obj) > 0)
                            {
                                s7_pointer x, iterator;
                                iterator = s7_make_iterator(sc, obj);
                                sc->temp8 = iterator;
                                sc->w = sc->nil;
                                while (true)
                                {
                                    x = s7_iterate(sc, iterator);
                                    if (iterator_is_at_end(iterator)) break;
                                    sc->w = cons(sc, x, sc->w);
                                }
                                x = sc->w;
                                sc->w = sc->nil;
                                sc->temp8 = sc->nil;
                                /* free_cell(sc, iterator); */ /* 16-Nov-18 but then 18-Dec-18 got free cell that was iterator */
                                return(x);
                            }
                            return(sc->nil);

                        case T_LET:
#if (!WITH_PURE_S7)
                            check_method_uncopied(sc, obj, sc->let_to_list_symbol, list_1(sc, obj));
#endif
                            return(s7_let_to_list(sc, obj));

                        case T_ITERATOR:
                            {
                                s7_pointer result, p = NULL;
                                s7_int results = 0;
                                result = sc->nil;
                                while (true)
                                {
                                    s7_pointer val;
                                    val = s7_iterate(sc, obj);
                                    if ((val == ITERATOR_END) &&
                                            (iterator_is_at_end(obj)))
                                    {
                                        sc->temp8 = sc->nil;
                                        return(result);
                                    }
                                    if (sc->safety > NO_SAFETY)
                                    {
                                        results++;
                                        if (results > 10000)
                                        {
                                            s7_warn(sc, 256, "iterator is creating a very long list!\n");
                                            results = S7_LONG_MIN;
                                        }
                                    }
                                    if (val != sc->no_value)
                                    {
                                        if (is_null(result))
                                        {
                                            if (is_multiple_value(val))
                                            {
                                                result = multiple_value(val);
                                                clear_multiple_value(val);
                                                for (p = result; is_pair(cdr(p)); p = cdr(p));
                                            }
                                            else
                                            {
                                                result = cons(sc, val, sc->nil);
                                                p = result;
                                            }
                                            sc->temp8 = result;
                                        }
                                        else
                                        {
                                            if (is_multiple_value(val))
                                            {
                                                set_cdr(p, multiple_value(val));
                                                clear_multiple_value(val);
                                                for (; is_pair(cdr(p)); p = cdr(p));
                                            }
                                            else
                                            {
                                                set_cdr(p, cons(sc, val, sc->nil));
                                                p = cdr(p);
                                            }}}}
                            }

                        case T_C_OBJECT:
                            {
                                int64_t i, len;
                                s7_pointer x, z, zc, result;
                                s7_int gc_z;

                                if (c_object_to_list(sc, obj))
                                    return((*(c_object_to_list(sc, obj)))(sc, set_plist_1(sc, obj)));

                                x = c_object_length(sc, obj);
                                if (s7_is_integer(x))
                                    len = s7_integer(x);
                                else return(sc->F);

                                if (len < 0)
                                    return(sc->F);
                                if (len == 0)
                                    return(sc->nil);

                                result = make_list(sc, len, sc->nil);
                                sc->temp8 = result;
                                z = list_2(sc, obj, sc->F);
                                zc = cdr(z);
                                gc_z = s7_gc_protect_1(sc, z);

                                set_car(sc->z2_1, sc->x);
                                set_car(sc->z2_2, sc->z);
                                for (i = 0, x = result; i < len; i++, x = cdr(x))
                                {
                                    set_car(zc, make_integer(sc, i));
                                    set_car(x, (*(c_object_ref(sc, obj)))(sc, z));
                                }
                                sc->x = car(sc->z2_1);
                                sc->z = car(sc->z2_2);
                                s7_gc_unprotect_at(sc, gc_z);
                                sc->temp8 = sc->nil;
                                return(result);
                            }
                    }
                    return(obj);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movzbl (%rsi), %eax
addl $-0x13, %eax
cmpl $0xa, %eax
ja 0x7a2c4
movq %rdi, %rbx
leaq 0x5a3a7(%rip), %rcx     # 0xd42dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f0f7
movq 0x8(%r14), %r15
movq 0x110(%rbx), %rbp
testq %r15, %r15
je 0x7a4f2
movq 0x10(%r14), %r14
leaq 0x9b9da(%rip), %r12     # 0x115950
movq %rbp, 0x4d8(%rbx)
testq %r15, %r15
jle 0x7a2e5
movzbl -0x1(%r14,%r15), %eax
movq (%r12,%rax,8), %r13
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x79faf
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r13, 0x8(%rax)
movq %rbp, 0x10(%rax)
decq %r15
movq %rax, %rbp
jmp 0x79f76
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rsi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7aad1
movq 0x28(%r14), %rax
cmpq $0x0, 0x18(%rax)
jle 0x7a49c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa3c7
movq %rax, %r14
movq %rax, 0x530(%rbx)
movq 0x110(%rbx), %rax
movq %rax, 0x4d8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq *0x28(%r14)
testb $-0x80, 0x3(%r14)
movq 0x4d8(%rbx), %rbp
je 0x7a2f8
movq %rax, %r12
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x7a063
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
jmp 0x7a01e
testb $0x40, 0x3(%r14)
je 0x7a2cc
cmpb $0x1, 0x24c(%rbx)
jne 0x7a2cc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0x1710(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x7a2cc
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x7a0ee
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r14, 0x8(%rdx)
movq %r12, 0x10(%rdx)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa34c
movq 0x8d8(%rbx), %rax
movq 0x8(%r14), %rcx
movq (%rax,%rcx,8), %rax
movq 0x78(%rax), %rax
testq %rax, %rax
je 0x7a312
movq 0x700(%rbx), %rcx
movq %r14, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq 0x110(%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r14, %rsi
callq *0x28(%r14)
movq %rax, %r15
cmpq 0x9b5d5(%rip), %rax     # 0x115760
jne 0x7a198
testb $-0x80, 0x3(%r14)
je 0x7a4df
cmpq $0x0, 0x6a0(%rbx)
jle 0x7a1cd
cmpq $0x2710, %rbp           # imm = 0x2710
jge 0x7a1b0
incq %rbp
jmp 0x7a1cd
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
leaq 0x68d53(%rip), %rdx     # 0xe2f12
xorl %eax, %eax
callq 0xd5c7
movq $-0x80000000, %rbp      # imm = 0x80000000
cmpq 0x138(%rbx), %r15
je 0x7a177
movq 0x110(%rbx), %r12
movzwl (%r15), %eax
cmpq %r12, 0x8(%rsp)
je 0x7a234
testw %ax, %ax
js 0x7a27c
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x7a210
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r15, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %rax, 0x10(%r13)
jmp 0x7a293
testw %ax, %ax
js 0x7a29b
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x7a258
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r13
movq $0x200001, (%r13)       # imm = 0x200001
movq %r15, 0x8(%r13)
movq %r12, 0x10(%r13)
movq %r13, %r15
jmp 0x7a2b3
movq %r15, 0x10(%r13)
andb $0x7f, 0x1(%r15)
movq %r13, %rax
movq 0x10(%r13), %r13
cmpb $0x1, (%r13)
je 0x7a285
movq %rax, %r13
jmp 0x7a177
andl $0x7fff, %eax           # imm = 0x7FFF
movw %ax, (%r15)
movq %r15, %rax
movq %rax, %r13
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0x7a2a7
movq %r15, 0x530(%rbx)
movq %r15, 0x8(%rsp)
jmp 0x7a177
movq %r14, %rbp
jmp 0x7a4f2
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9f90
movq 0x110(%rbx), %rax
movq %rax, 0x4d8(%rbx)
jmp 0x7a4f2
movq 0x110(%rbx), %rax
movq %rax, 0x4d8(%rbx)
movq %rax, 0x530(%rbx)
jmp 0x7a4f2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7ab5d
cmpb $0xb, (%rax)
jne 0x7a4a5
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
js 0x7a4a5
je 0x7a49c
movq 0x110(%rbx), %rdx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x2ddf5
movq %rax, 0x8(%rsp)
movq %rax, 0x530(%rbx)
movq 0x120(%rbx), %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x7a38b
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rsi
movl $0x200001, %eax         # imm = 0x200001
movq %rax, (%rsi)
movq %r15, 0x8(%rsi)
movq %r12, 0x10(%rsi)
movq 0x90(%rbx), %rcx
leaq -0x8(%rcx), %rdx
movq %rdx, 0x90(%rbx)
movq -0x8(%rcx), %rbp
movq %rax, (%rbp)
movq %r14, 0x8(%rbp)
movq %rsi, 0x20(%rsp)
movq %rsi, 0x10(%rbp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x89a9
movq %rax, 0x18(%rsp)
movq 0x4e0(%rbx), %rax
movq 0x598(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x4f0(%rbx), %rax
movq 0x5a0(%rbx), %rcx
movq %rax, 0x8(%rcx)
leaq 0x9b544(%rip), %r13     # 0x115950
xorl %r12d, %r12d
movq 0x8(%rsp), %r15
cmpq %r12, 0x10(%rsp)
je 0x7a4ae
cmpq $0x7ff, %r12            # imm = 0x7FF
ja 0x7a42e
movq (%r13), %rax
jmp 0x7a467
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x7a44d
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xb, (%rax)
movq %r12, 0x8(%rax)
movq 0x20(%rsp), %rcx
movq %rax, 0x8(%rcx)
movq 0x8d8(%rbx), %rax
movq 0x8(%r14), %rcx
movq (%rax,%rcx,8), %rax
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x48(%rax)
movq %rax, 0x8(%r15)
incq %r12
movq 0x10(%r15), %r15
addq $0x8, %r13
jmp 0x7a414
movq 0x110(%rbx), %rbp
jmp 0x7a4f2
movq 0x120(%rbx), %rbp
jmp 0x7a4f2
movq 0x598(%rbx), %rax
movq 0x5a0(%rbx), %rcx
movq 0x8(%rax), %rax
movq %rax, 0x4e0(%rbx)
movq 0x8(%rcx), %rax
movq %rax, 0x4f0(%rbx)
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x8b00
movq 0x110(%rbx), %rax
movq %rax, 0x530(%rbx)
movq 0x8(%rsp), %rbp
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq