// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_owlet
static s7_pointer g_owlet(s7_scheme *sc, s7_pointer args)
                {
#if WITH_HISTORY
#define H_owlet "(owlet) returns the environment at the point of the last error. \
                    It has the additional local variables: error-type, error-data, error-code, error-line, error-file, and error-history."
#else
#define H_owlet "(owlet) returns the environment at the point of the last error. \
                    It has the additional local variables: error-type, error-data, error-code, error-line, and error-file."
#endif
#define Q_owlet s7_make_signature(sc, 1, sc->is_let_symbol)
                    /* if owlet is not copied, (define e (owlet)), e changes as owlet does! */

                    s7_pointer e, x;
                    s7_int gc_loc;

                    e = let_copy(sc, sc->owlet);
                    gc_loc = s7_gc_protect_1(sc, e);

                    /* make sure the pairs/reals/strings/integers are copied: should be error-data, error-code, and possibly error-history */
                    sc->gc_off = true;

                    for (x = let_slots(e); tis_slot(x); x = next_slot(x))
                        if (is_pair(slot_value(x)))
                        {
                            s7_pointer new_list, p, sp;
                            new_list = protected_list_copy(sc, slot_value(x));
                            slot_set_value(x, new_list);
                            for (p = new_list, sp = p; is_pair(p); p = cdr(p), sp = cdr(sp))
                            {
                                s7_pointer val;
                                val = car(p);
                                if (is_t_real(val))
                                    set_car(p, make_real(sc, real(val)));
                                else
                                {
                                    if (is_string(val))
                                        set_car(p, make_string_with_length(sc, string_value(val), string_length(val)));
                                    else
                                    {
                                        if (is_t_integer(val))
                                            set_car(p, make_integer(sc, integer(val)));
                                    }
                                }
                                p = cdr(p);
                                if ((!is_pair(p)) || (p == sp)) break;
                                val = car(p);
                                if (is_t_real(val))
                                    set_car(p, make_real(sc, real(val)));
                                else
                                {
                                    if (is_string(val))
                                        set_car(p, make_string_with_length(sc, string_value(val), string_length(val)));
                                }
                            }
                        }

                    sc->gc_off = false;
                    s7_gc_unprotect_at(sc, gc_loc);
                    return(e);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x198(%rdi), %rsi
callq 0x7c4ba
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89a9
movq %rax, 0x8(%rsp)
movb $0x1, 0x218(%rbx)
movq %r13, 0x10(%rsp)
addq $0x8, %r13
leaq 0xc8031(%rip), %rbp     # 0x115950
movq (%r13), %r13
testq %r13, %r13
je 0x4dac2
movq 0x10(%r13), %rsi
cmpb $0x1, (%rsi)
jne 0x4dab9
movq %rbx, %rdi
callq 0x72e87
movq %rax, %r15
movq %rax, 0x10(%r13)
movq %rax, %r12
cmpb $0x1, (%r12)
jne 0x4dab9
movq 0x8(%r12), %rax
movzbl (%rax), %ecx
cmpl $0xb, %ecx
je 0x4d9ce
cmpl $0x13, %ecx
je 0x4d9bc
cmpl $0xd, %ecx
jne 0x4da20
movsd 0x8(%rax), %xmm0
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x4d99f
movq %rbx, %rdi
movsd %xmm0, (%rsp)
callq 0x9c27
movsd (%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xd, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x4da1b
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0xd11d
jmp 0x4da1b
movq 0x8(%rax), %r14
cmpq $0x7ff, %r14            # imm = 0x7FF
ja 0x4d9e2
movq (%rbp,%r14,8), %rax
jmp 0x4da1b
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x4da01
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 %r14, 0x8(%rax)
movq %rax, 0x8(%r12)
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
jne 0x4dab9
cmpq %r15, %r12
je 0x4dab9
movq 0x8(%r12), %rax
movzbl (%rax), %ecx
cmpl $0x13, %ecx
je 0x4da96
cmpl $0xd, %ecx
jne 0x4daab
movsd 0x8(%rax), %xmm0
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x4da79
movq %rbx, %rdi
movsd %xmm0, (%rsp)
callq 0x9c27
movsd (%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xd, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x4daa6
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0xd11d
movq %rax, 0x8(%r12)
movq 0x10(%r12), %r12
movq 0x10(%r15), %r15
jmp 0x4d94b
addq $0x18, %r13
jmp 0x4d91f
movb $0x0, 0x218(%rbx)
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x8b00
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq