// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %rcx
testb $-0x80, 0x6(%rdx)
je 0xc92f
movq 0x8(%rcx), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rcx
cmpq %rsi, 0x150(%rdi)
je 0xc9cc
movq 0x18(%rsi), %rax
cmpq 0x20(%rcx), %rax
jne 0xc97e
movq 0x18(%rcx), %r14
cmpb $0x20, (%r14)
jne 0xc97e
movq (%r14), %rax
btl $0x12, %eax
jb 0xcba3
btl $0x18, %eax
jae 0xcbb1
movq 0x145ffa(%rip), %rax    # 0x152968
movq 0x1240(%rdi), %rcx
movq 0x8(%r14), %rdx
jmp 0xcadf
cmpb $0x1c, (%rsi)
jne 0xc9ab
movq %rsi, %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0xc9a2
movq 0x8(%r14), %rdx
cmpq %rcx, %rdx
je 0xcaba
movq 0x18(%r14), %r14
jmp 0xc98a
movq 0x10(%rax), %rax
cmpb $0x1c, (%rax)
je 0xc986
movl (%rsi), %eax
notl %eax
testl $0x48000000, %eax       # imm = 0x48000000
jne 0xcb39
movq %rcx, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc866
testb $0x1, 0x3(%rcx)
jne 0xcb0d
testb $0x1, 0x6(%rcx)
je 0xca52
movq 0x8(%rdi), %rdx
movq 0x18(%rdx), %r9
movq 0x20(%rcx), %r8
movl $0x18, %eax
cmpq %r8, %r9
je 0xca3d
jle 0xca01
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %r9
cmpq %r9, %r8
jl 0xc9f4
cmpq %r8, %r9
je 0xca3d
movl $0x10, %eax
cmpb $0x1c, (%rdx)
jne 0xca3d
movq 0x8(%rdx), %r9
testq %r9, %r9
sete %r10b
je 0xca2f
cmpq %rcx, 0x8(%r9)
je 0xca29
movq 0x18(%r9), %r9
jmp 0xca14
xorl %r10d, %r10d
movq %r9, %r8
testb %r10b, %r10b
je 0xca41
movq 0x10(%rdx), %rdx
cmpb $0x1c, (%rdx)
je 0xca10
movq (%rcx,%rax), %r8
cmpb $0x20, (%r8)
jne 0xca52
testb $0x1, 0x3(%r8)
jne 0xcb0d
movq 0x10(%rcx), %r14
cmpb $0x20, (%r14)
jne 0xcb39
movq 0x10(%r14), %rax
cmpb $0x9, (%rax)
jne 0xcb9c
movq 0x1240(%rdi), %rax
movq 0x8(%rax), %rsi
movq 0x141ee1(%rip), %rdx    # 0x14e960
movq 0x140(%rdi), %r8
movq 0x820(%rdi), %rax
movslq 0x7dc(%rdi), %r10
movq (%rax,%r10,8), %r9
leal 0x1(%r10), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rdi)
leaq 0x112a51(%rip), %rax    # 0x11f4fd
movq %rax, 0x10(%r9)
movq $0x17, 0x8(%r9)
jmp 0xcb2d
movq (%r14), %rax
btl $0x12, %eax
jb 0xcba3
btl $0x18, %eax
jae 0xcbb1
movq 0x145e90(%rip), %rax    # 0x152968
movq 0x1240(%rdi), %rcx
movq 0x6e8(%rdi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x6e8(%rdi), %rdx
movq 0xea8(%rdi), %rbx
jmp 0xcb92
movq 0x1240(%rdi), %rax
movq 0x8(%rax), %rsi
movq 0x141e41(%rip), %rdx    # 0x14e960
movq 0x140(%rdi), %r8
movq 0x14938b(%rip), %r9     # 0x155eb8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb31d
movq 0x1940(%rdi), %rbx
movq 0x820(%rdi), %rax
movslq 0x7dc(%rdi), %rdx
movq (%rax,%rdx,8), %rax
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rdi)
leaq 0x1129b1(%rip), %rdx    # 0x11f515
movq %rdx, 0x10(%rax)
movq $0x21, 0x8(%rax)
movq 0x6e8(%rdi), %rdx
movq %rax, 0x8(%rdx)
movq 0x10(%rdx), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x6e8(%rdi), %rdx
movq %rbx, %rsi
callq 0x3b366
jmp 0xcbb5
testb $0x4, 0x2(%r14)
je 0xcbb1
movq %r14, %rsi
movq %rbx, %rdx
callq 0x953ff
movq %rax, %rbx
movq %rbx, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq