// File: /workspace/github_c_makefile_star2_O3/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 0xbab0
movq 0x8(%rcx), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rcx
cmpq %rsi, 0x150(%rdi)
je 0xbb4d
movq 0x18(%rsi), %rax
cmpq 0x20(%rcx), %rax
jne 0xbaff
movq 0x18(%rcx), %r14
cmpb $0x20, (%r14)
jne 0xbaff
movq (%r14), %rax
btl $0x12, %eax
jb 0xbcee
btl $0x18, %eax
jae 0xbd17
movq 0x13ee79(%rip), %rax    # 0x14a968
movq 0x1240(%rdi), %rcx
movq 0x8(%r14), %rdx
jmp 0xbc31
cmpb $0x1c, (%rsi)
jne 0xbb2c
movq %rsi, %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0xbb23
movq 0x8(%r14), %rdx
cmpq %rcx, %rdx
je 0xbc0c
movq 0x18(%r14), %r14
jmp 0xbb0b
movq 0x10(%rax), %rax
cmpb $0x1c, (%rax)
je 0xbb07
movl (%rsi), %eax
notl %eax
testl $0x48000000, %eax       # imm = 0x48000000
jne 0xbc8b
movq %rcx, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb9e7
movq (%rcx), %rax
btl $0x18, %eax
jb 0xbc5f
btq $0x30, %rax
jae 0xbba4
movq 0x8(%rdi), %rdx
movq 0x18(%rdx), %r9
movq 0x20(%rcx), %r8
movl $0x18, %eax
cmpq %r8, %r9
je 0xbb8f
jle 0xbb86
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %r9
cmpq %r9, %r8
jl 0xbb79
cmpq %r8, %r9
jne 0xbd26
movq (%rcx,%rax), %r8
cmpb $0x20, (%r8)
jne 0xbba4
testb $0x1, 0x3(%r8)
jne 0xbc5f
movq 0x10(%rcx), %r14
cmpb $0x20, (%r14)
jne 0xbc8b
movq 0x10(%r14), %rax
cmpb $0x9, (%rax)
jne 0xbd02
movq 0x1240(%rdi), %rax
movq 0x8(%rax), %rsi
movq 0x13ad8f(%rip), %rdx    # 0x146960
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 0x10aa0f(%rip), %rax    # 0x11660d
movq %rax, 0x10(%r9)
movq $0x17, 0x8(%r9)
jmp 0xbc7f
movq (%r14), %rax
btl $0x12, %eax
jb 0xbcee
btl $0x18, %eax
jae 0xbd17
movq 0x13ed3e(%rip), %rax    # 0x14a968
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 0xbce4
movq 0x1240(%rdi), %rax
movq 0x8(%rax), %rsi
movq 0x13acef(%rip), %rdx    # 0x146960
movq 0x140(%rdi), %r8
movq 0x142239(%rip), %r9     # 0x14deb8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa4e4
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 0x10a96f(%rip), %rdx    # 0x116625
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 0x38dfa
jmp 0xbd1b
movq %r14, %rsi
movq %rbx, %rdx
callq 0x8f082
movq %rax, %rbx
movq %rax, 0x10(%r14)
jmp 0xbd1b
testb $0x4, 0x2(%r14)
je 0xbd17
movq %r14, %rsi
movq %rbx, %rdx
callq 0x8f082
movq %rax, %rbx
movq %rbx, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %eax
cmpb $0x1c, (%rdx)
jne 0xbb8f
movq 0x8(%rdx), %r8
testq %r8, %r8
je 0xbd4d
cmpq %rcx, 0x8(%r8)
je 0xbb93
movq 0x18(%r8), %r8
jmp 0xbd38
movq 0x10(%rdx), %rdx
jmp 0xbd2b