// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: let_set_1
static s7_pointer let_set_1(s7_scheme *sc, s7_pointer env, s7_pointer symbol, s7_pointer value)
    {
        s7_pointer x, y;

        if (is_keyword(symbol))
            symbol = keyword_symbol(symbol);

        if (env == sc->rootlet)
        {
            if (is_constant_symbol(sc, symbol))  /* (let-set! (rootlet) 'pi #f) */
                return(wrong_type_argument_with_type(sc, sc->let_set_symbol, 2, symbol, a_non_constant_symbol_string));

            y = global_slot(symbol);
            if (is_slot(y))
            {
                if (is_syntax(slot_value(y)))
                    return(wrong_type_argument_with_type(sc, sc->let_set_symbol, 2, symbol, wrap_string(sc, "a non-syntactic keyword", 23)));

                if (slot_has_setter(y))
                    slot_set_value(y, call_setter(sc, y, value));
                else slot_set_value(y, value);
                return(slot_value(y));
            }
            return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_3(sc, wrap_string(sc, "let-set!: ~A is not defined in ~A", 33), symbol, env)));
        }

        if (let_id(env) == symbol_id(symbol))
        {
            y = local_slot(symbol);
            if (is_slot(y))
                return(checked_slot_set_value(sc, y, value));
        }

        for (x = env; is_let(x); x = outlet(x))
            for (y = let_slots(x); tis_slot(y); y = next_slot(y))
                if (slot_symbol(y) == symbol)
                    return(checked_slot_set_value(sc, y, value));

        if (has_methods(env))
        {
            if (has_let_set_fallback(env))
                return(call_let_set_fallback(sc, env, symbol, value));
        }

        return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_3(sc, wrap_string(sc, "let-set!: ~A is not defined in ~A", 33), symbol, env)));
        /* not sure about this -- what's the most useful choice? */
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
testb $-0x80, 0x6(%rdx)
je 0xadaf
movq 0x8(%r15), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %r15
cmpq %r12, 0x150(%r14)
je 0xae0d
movq 0x18(%r12), %rcx
movq %r12, %rax
cmpq 0x20(%r15), %rcx
jne 0xade6
movq 0x18(%r15), %rsi
cmpb $0x20, (%rsi)
movq %r12, %rax
jne 0xade6
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x72e20
cmpb $0x1c, (%rax)
jne 0xaed6
leaq 0x8(%rax), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xae07
cmpq %r15, 0x8(%rsi)
je 0xadd2
addq $0x18, %rsi
jmp 0xadf3
movq 0x10(%rax), %rax
jmp 0xade6
movq %r14, %rdi
movq %r15, %rsi
callq 0x72bfa
testb %al, %al
je 0xae50
movq 0x1240(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10ab32(%rip), %rdx    # 0x115960
movq 0x140(%r14), %r8
movq 0x11207c(%rip), %r9     # 0x11ceb8
movq %r14, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9bbb
movq 0x10(%r15), %r13
cmpb $0x20, (%r13)
jne 0xaefd
movq 0x10(%r13), %rax
cmpb $0x9, (%rax)
jne 0xaeb5
movq 0x1240(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10aae6(%rip), %rdx    # 0x115960
movq 0x140(%r14), %r8
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %r9
leal 0x1(%rcx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%r14)
leaq 0xd7706(%rip), %rax     # 0xe25ad
movq %rax, 0x10(%r9)
movq $0x17, 0x8(%r9)
jmp 0xae3c
testb $0x4, 0x2(%r13)
je 0xaecd
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x72c28
movq %rax, %rbx
movq %rbx, 0x10(%r13)
jmp 0xaf62
movl (%r12), %eax
notl %eax
testl $0x48000000, %eax       # imm = 0x48000000
jne 0xaefd
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xacdb
movq 0x1940(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0xd769c(%rip), %rcx     # 0xe25c5
movq %rcx, 0x10(%rax)
movq $0x21, 0x8(%rax)
movq 0x6e8(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %r15, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r12, 0x8(%rax)
movq 0x6e8(%r14), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2cdc0
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq