// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_set_setter
static s7_pointer g_set_setter(s7_scheme *sc, s7_pointer args)
                {
                    s7_pointer p, setter;

                    p = car(args);
                    /* should we check that p != setter?
                     *   (set! (setter <) <) -> <
                     *   (set! (< 3 2) 3) -> #f
                     *   (set! (< 1) 2) -> #t
                     */

                    if (is_symbol(p))
                    {
                        s7_pointer sym, func, slot;
                        sym = p;
                        if (is_keyword(sym))
                            return(s7_wrong_type_arg_error(sc, "set! setter", 1, sym, "a normal symbol (a keyword can't be set)"));

                        if (is_pair(cddr(args)))
                        {
                            s7_pointer e, old_e;
                            e = cadr(args);
                            func = caddr(args);
                            if ((e == sc->rootlet) || (e == sc->nil))
                                slot = global_slot(sym);
                            else
                            {
                                if (!is_let(e))
                                    return(s7_wrong_type_arg_error(sc, "set! symbol-setter", 2, e, "a let"));
                                old_e = sc->envir;
                                sc->envir = e;
                                slot = symbol_to_slot(sc, sym);
                                sc->envir = old_e;
                            }
                        }
                        else
                        {
                            slot = symbol_to_slot(sc, sym);
                            func = cadr(args);
                        }
                        if ((!is_any_procedure(func)) && /* disallow continuation/goto here */
                                (func != sc->F))
                            return(s7_wrong_type_arg_error(sc, "set! setter", 3, func, "a function or #f"));

                        if (sym == sc->setter_symbol)
                            return(immutable_object_error(sc, set_elist_2(sc, wrap_string(sc, "can't set (setter setter) to ~S", 31), func)));

                        if (!is_slot(slot))
                            return(sc->F);

                        if (slot == global_slot(sym))
                        {
                            s7_set_setter(sc, sym, func); /* special GC protection for global vars */
                            return(func);
                        }

                        slot_set_setter(slot, func);
                        if (func != sc->F)
                        {
                            slot_set_has_setter(slot);
                            if (s7_is_aritable(sc, func, 3))
                                set_has_let_arg(func);
                            symbol_set_has_setter(sym);
                        }
                        return(func);
                    }

                    setter = cadr(args);
                    if ((setter != sc->F) &&
                            (!is_any_procedure(setter)))
                        return(s7_wrong_type_arg_error(sc, "set! setter", 2, setter, "a procedure or #f"));
                    if (p == sc->s7_let)
                        return(s7_wrong_type_arg_error(sc, "set! setter", 1, p, "something other than *s7*"));

                    switch (type(p))
                    {
                        case T_MACRO:   case T_MACRO_STAR:
                        case T_BACRO:   case T_BACRO_STAR:
                        case T_CLOSURE: case T_CLOSURE_STAR:
                            closure_set_setter(p, setter);
                            if (setter == sc->F)
                                closure_set_no_setter(p);
                            break;

                        case T_C_FUNCTION:
                        case T_C_ANY_ARGS_FUNCTION:
                        case T_C_OPT_ARGS_FUNCTION:
                        case T_C_RST_ARGS_FUNCTION:
                        case T_C_FUNCTION_STAR:
                            if (p == slot_value(global_slot(sc->setter_symbol)))
                                return(immutable_object_error(sc, set_elist_2(sc, wrap_string(sc, "can't set (setter setter) to ~S", 31), setter)));
                            c_function_set_setter(p, setter);
                            if ((is_any_closure(setter)) ||
                                    (is_any_macro(setter)))
                                add_setter(sc, p, setter);
                            break;

                        case T_C_MACRO:
                            c_macro_set_setter(p, setter);
                            if ((is_any_closure(setter)) ||
                                    (is_any_macro(setter)))
                                add_setter(sc, p, setter);
                            break;

                        case T_SLOT:
                            slot_set_setter(p, setter);
                            slot_set_has_setter(p);
                            break;
                    }
                    return(setter);
                }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x3e3a3
movq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movzwl 0x6(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x3e106
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rcx
leaq 0x1b0cbc(%rip), %rsi    # 0x1eeda7
movl $0x1, %edx
leaq 0x1b0cbc(%rip), %r8     # 0x1eedb3
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x3e1f6
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x150(%rcx), %rax
je 0x3e16d
movq 0x30(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x3e17d
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x3e1f4
movq 0x30(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
je 0x3e1b6
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rcx
leaq 0x1b0c41(%rip), %rsi    # 0x1eeddc
movl $0x2, %edx
leaq 0x1b0c48(%rip), %r8     # 0x1eedef
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xfc80
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x3e21c
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xfc80
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x28, %eax
jge 0x3e268
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x120(%rcx), %rax
je 0x3e268
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rcx
leaq 0x1b0b5a(%rip), %rsi    # 0x1eeda7
movl $0x3, %edx
leaq 0x1b0b9c(%rip), %r8     # 0x1eedf5
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x48(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x14a0(%rcx), %rax
jne 0x3e2ce
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x1b0b6b(%rip), %rsi    # 0x1eee06
movl $0x1f, %edx
callq 0xb880
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq 0x40(%rsp), %rdx
callq 0xb830
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xb800
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
je 0x3e2f1
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x3e324
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x3db90
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x3de20
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x120(%rcx), %rax
je 0x3e394
movq 0x38(%rsp), %rax
movq (%rax), %rcx
orq $0x40000, %rcx          # imm = 0x40000
movq %rcx, (%rax)
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl $0x3, %edx
callq 0x3cbf0
testb $0x1, %al
jne 0x3e372
jmp 0x3e382
movq 0x40(%rsp), %rax
movzwl 0x6(%rax), %ecx
orl $0x1, %ecx
movw %cx, 0x6(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rcx
orq $0x40000, %rcx          # imm = 0x40000
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x120(%rcx), %rax
je 0x3e401
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x28, %eax
jge 0x3e401
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rcx
leaq 0x1b09c1(%rip), %rsi    # 0x1eeda7
movl $0x2, %edx
leaq 0x1b0a34(%rip), %r8     # 0x1eee26
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x58(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x2150(%rcx), %rax
jne 0x3e440
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x1b0982(%rip), %rsi    # 0x1eeda7
movl $0x1, %edx
leaq 0x1b0a07(%rip), %r8     # 0x1eee38
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x13, %eax
ja 0x3e5e1
movq 0x10(%rsp), %rax
leaq 0x1a0255(%rip), %rcx    # 0x1de6bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x50(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x3e4a3
movq 0x58(%rsp), %rax
movq (%rax), %rcx
orq $0x40000, %rcx          # imm = 0x40000
movq %rcx, (%rax)
jmp 0x3e5e1
movq 0x58(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x14a0(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x3e514
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rdi
leaq 0x1b0924(%rip), %rsi    # 0x1eee06
movl $0x1f, %edx
callq 0xb880
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x50(%rsp), %rdx
callq 0xb830
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xb800
movq %rax, 0x70(%rsp)
jmp 0x3e5eb
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x30(%rax)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1e41f9(%rip), %rax    # 0x222730
testb $0x1, (%rax,%rcx)
jne 0x3e554
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1dd952(%rip), %rax    # 0x21bea0
testb $0x1, (%rax,%rcx)
je 0x3e568
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0xd9a60
jmp 0x3e5e1
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x30(%rax)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1e41a3(%rip), %rax    # 0x222730
testb $0x1, (%rax,%rcx)
jne 0x3e5aa
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1dd8fc(%rip), %rax    # 0x21bea0
testb $0x1, (%rax,%rcx)
je 0x3e5be
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0xd9a60
jmp 0x3e5e1
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x3de20
movq 0x58(%rsp), %rax
movq (%rax), %rcx
orq $0x40000, %rcx          # imm = 0x40000
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)