// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: op_define_with_setter
static void op_define_with_setter(s7_scheme *sc)
                {
                    if ((is_immutable(sc->envir)) &&
                            (is_let(sc->envir))) /* not () */
                        eval_error_no_return(sc, sc->syntax_error_symbol, "define ~S: let is immutable", 27, sc->code);

                    if ((is_any_closure(sc->value)) &&
                            ((!(is_let(closure_let(sc->value)))) ||
                             (!(is_funclet(closure_let(sc->value))))))  /* otherwise it's (define f2 f1) or something similar */
                    {
                        s7_pointer new_func, new_env;
                        new_func = sc->value;
                        new_env = make_funclet(sc, new_func, sc->code, closure_let(new_func));
                        /* this should happen only if the closure* default values do not refer in any way to
                         *   the enclosing environment (else we can accidentally shadow something that happens
                         *   to share an argument name that is being used as a default value -- kinda dumb!).
                         *   I think I'll check this before setting the safe_closure bit.
                         */

                        if ((port_filename(sc->input_port)) &&
                                (port_file(sc->input_port) != stdin))
                        {
                            /* unbound_variable will be called if __func__ is encountered, and will return this info as if __func__ had some meaning */
                            let_set_file(new_env, port_file_number(sc->input_port));
                            let_set_line(new_env, port_line_number(sc->input_port));
                            set_has_let_file(new_env);
                        }
                        else
                        {
                            let_set_file(new_env, 0);
                            let_set_line(new_env, 0);
                            clear_has_let_file(new_env);
                        }

                        /* add the newly defined thing to the current environment */
                        if (is_let(sc->envir))
                        {
                            if (let_id(sc->envir) < symbol_id(sc->code)) /* we're adding a later-bound symbol to an old let (?) */
                            {
                                s7_pointer slot;
                                sc->let_number++; /* dummy let, force symbol lookup */

                                for (slot = let_slots(sc->envir); tis_slot(slot); slot = next_slot(slot))
                                    if (slot_symbol(slot) == sc->code)
                                    {
                                        if (is_immutable(slot))
                                            eval_error_no_return(sc, sc->syntax_error_symbol, "define ~S: but it is immutable", 30, sc->code);
                                        slot_set_value(slot, new_func);
                                        symbol_set_local(sc->code, sc->let_number, slot);
                                        set_local(sc->code);
                                        sc->value = new_func; /* probably not needed? */
                                        return;
                                    }
                                new_cell_no_check(sc, slot, T_SLOT);
                                slot_set_symbol(slot, sc->code);
                                slot_set_value(slot, new_func);
                                symbol_set_local(sc->code, sc->let_number, slot);
                                slot_set_next(slot, let_slots(sc->envir));
                                let_set_slots(sc->envir, slot);
                            }
                            else add_slot(sc->envir, sc->code, new_func);
                            set_local(sc->code);
                        }
                        else
                        {
                            if ((is_slot(global_slot(sc->code))) &&
                                    (is_immutable(global_slot(sc->code))))
                            {
                                s7_pointer old_value, old_symbol;
                                old_symbol = sc->code;
                                old_value = slot_value(global_slot(sc->code));
                                if ((type(old_value) != type(new_func)) ||
                                        (!s7_is_equivalent(sc, old_value, new_func)))    /* if value is unchanged, just ignore this (re)definition */
                                    eval_error_no_return(sc, sc->syntax_error_symbol, "define ~S: but it is immutable", 30, old_symbol);
                            }
                            s7_make_slot(sc, sc->envir, sc->code, new_func);
                        }
                        sc->value = new_func; /* 25-Jul-14 so define returns the value not the name */
                    }
                    else
                    {
                        s7_pointer lx;
                        /* add the newly defined thing to the current environment */
                        lx = symbol_to_local_slot(sc, sc->code, sc->envir);
                        if (is_slot(lx))
                        {
                            if (is_immutable(lx))
                            {
                                s7_pointer old_value, old_symbol;
                                old_symbol = sc->code;
                                old_value = slot_value(lx);
                                if ((type(old_value) != type(sc->value)) ||
                                        (!s7_is_equivalent(sc, old_value, sc->value)))    /* if value is unchanged, just ignore this (re)definition */
                                    eval_error_no_return(sc, sc->syntax_error_symbol, "define ~S: but it is immutable", 30, old_symbol);
                            }
                            slot_set_value_with_hook(lx, sc->value);
                        }
                        else s7_make_slot(sc, sc->envir, sc->code, sc->value);
                    }
                }

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1403a3
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0x1403a3
movq 0xc0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xc0(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xb0048(%rip), %rsi     # 0x1f03b7
movl $0x1b, %edx
callq 0xb880
movq 0x50(%rsp), %rdi
movq %rax, %rsi
movq 0xc0(%rsp), %rax
movq (%rax), %rdx
callq 0xb830
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xe2375(%rip), %rax     # 0x222730
testb $0x1, (%rax,%rcx)
je 0x140a58
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0x140400
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
andq $0x20000000, %rax       # imm = 0x20000000
cmpq $0x0, %rax
jne 0x140a58
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rax
movq (%rax), %rdx
movq 0xb8(%rsp), %rax
movq 0x18(%rax), %rcx
callq 0x18bcc0
movq %rax, 0xb0(%rsp)
movq 0xc0(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x1404dc
movq 0xc0(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd4b58(%rip), %rcx     # 0x214fd8
cmpq (%rcx), %rax
je 0x1404dc
movq 0xc0(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
movl 0x24(%rax), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x2c(%rax)
movq 0xc0(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0xb0(%rsp), %rax
movzwl 0x6(%rax), %ecx
orl $0x2, %ecx
movw %cx, 0x6(%rax)
jmp 0x14050d
movq 0xb0(%rsp), %rax
movl $0x0, 0x2c(%rax)
movq 0xb0(%rsp), %rax
movl $0x0, 0x28(%rax)
movq 0xb0(%rsp), %rax
movzwl 0x6(%rax), %ecx
andl $-0x3, %ecx
movw %cx, 0x6(%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0x1408fd
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq 0xc0(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0x20(%rcx), %rax
jge 0x1407d2
movq 0xc0(%rsp), %rax
movq 0x250(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x250(%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x1406eb
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xc0(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x1406d0
movq 0xa8(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x140630
movq 0xc0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xc0(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xafdd7(%rip), %rsi     # 0x1f03d3
movl $0x1e, %edx
callq 0xb880
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0xc0(%rsp), %rax
movq (%rax), %rdx
callq 0xb830
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0xb8(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
movq 0xc0(%rsp), %rax
movq 0x250(%rax), %rcx
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x20(%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rcx
orq $0x100000, %rcx         # imm = 0x100000
andq $-0x12201, %rcx         # imm = 0xFFFEDDFF
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x140c03
jmp 0x1406d2
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0xa8(%rsp)
jmp 0x14057c
jmp 0x1406ed
movq 0xc0(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq $0x20, (%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xb8(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
movq 0xc0(%rsp), %rax
movq 0x250(%rax), %rcx
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x20(%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0xa8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x1408ce
jmp 0x1407d4
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xc0(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq $0x20, (%rax)
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x98(%rsp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0xa0(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x1408ce
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rcx
orq $0x100000, %rcx         # imm = 0x100000
andq $-0x12201, %rcx         # imm = 0xFFFEDDFF
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
jmp 0x140a3f
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jne 0x140a13
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x140a13
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
movq 0xb8(%rsp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x1409a3
movq 0xc0(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0xb8(%rsp), %rdx
callq 0x3e930
testb $0x1, %al
jne 0x140a11
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xc0(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xaf9f3(%rip), %rsi     # 0x1f03d3
movl $0x1e, %edx
callq 0xb880
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rdx
callq 0xb830
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
jmp 0x140a13
movq 0xc0(%rsp), %rdi
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xc0(%rsp), %rax
movq (%rax), %rdx
movq 0xb8(%rsp), %rcx
callq 0xb450
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x140c03
movq 0xc0(%rsp), %rdi
movq 0xc0(%rsp), %rax
movq (%rax), %rsi
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x101d0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jne 0x140bd1
movq 0x78(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x140b72
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movzbl (%rax), %eax
movq 0xc0(%rsp), %rcx
movq 0x20(%rcx), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x140b05
movq 0xc0(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0x3e930
testb $0x1, %al
jne 0x140b70
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc0(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xaf891(%rip), %rsi     # 0x1f03d3
movl $0x1e, %edx
callq 0xb880
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rdx
callq 0xb830
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
jmp 0x140b72
jmp 0x140b74
movq 0xc0(%rsp), %rdi
movq 0xc0(%rsp), %rax
movq 0x200(%rax), %rsi
callq 0xba20
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x140bb8
movq 0xc0(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0xba60
jmp 0x140bcd
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x140bcf
jmp 0x140c01
movq 0xc0(%rsp), %rdi
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xc0(%rsp), %rax
movq (%rax), %rdx
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rcx
callq 0xb450
jmp 0x140c03
addq $0xc8, %rsp
retq
nopl (%rax,%rax)