// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: set_implicit
static goto_t set_implicit(s7_scheme *sc) /* sc->code incoming is (set! (...) ...) */
                {
                    s7_pointer caar_code, cx, form;

                    form = sc->code;
                    sc->code = cdr(sc->code);
                    caar_code = caar(sc->code);
                    if (is_pair(caar_code))
                    {
                        push_stack(sc, OP_SET2, cdar(sc->code), cdr(sc->code));
                        sc->code = caar_code;
                        sc->cur_op = optimize_op(sc->code);
                        return(goto_top_no_pop);
                    }

                    if (is_symbol(caar_code))
                    {
                        /* this was cx = s7_symbol_value(sc, caar_code) but the function call overhead is noticeable */
                        cx = symbol_to_slot(sc, caar_code);
                        if (is_slot(cx))
                            cx = slot_value(cx);
                        else s7_error(sc, sc->syntax_error_symbol, set_elist_3(sc, no_setter_string, caar_code, prepackaged_type_names[type(cx)]));
                    }
                    else cx = caar_code;

                    /* code here is the setter and the value without the "set!": ((window-width) 800) */
                    /*    (set! (hi 0) (* 2 3)) -> ((hi 0) (* 2 3)) */
                    /* for gmp case, indices need to be decoded via s7_integer, not just integer */

                    switch (type(cx))
                    {
                        case T_C_OBJECT:
                            return(set_implicit_c_object(sc, cx));

                        case T_INT_VECTOR: case T_FLOAT_VECTOR: case T_VECTOR: case T_BYTE_VECTOR:
                            return(set_implicit_vector(sc, cx, form));

                        case T_STRING:
                            return(set_implicit_string(sc, cx));

                        case T_PAIR:
                            return(set_implicit_pair(sc, cx));

                        case T_HASH_TABLE:
                            return(set_implicit_hash_table(sc, cx));

                        case T_LET:
                            return(set_implicit_let(sc, cx));

                        case T_C_MACRO: case T_C_OPT_ARGS_FUNCTION: case T_C_RST_ARGS_FUNCTION:
                        case T_C_ANY_ARGS_FUNCTION: case T_C_FUNCTION: case T_C_FUNCTION_STAR:
                            return(set_implicit_function(sc, cx));

                        case T_MACRO: case T_MACRO_STAR: case T_BACRO: case T_BACRO_STAR:
                        case T_CLOSURE: case T_CLOSURE_STAR:
                            return(set_implicit_closure(sc, cx));

                        case T_ITERATOR:     /* not sure this makes sense */
                            return(set_implicit_iterator(sc, cx));

                        case T_SYNTAX:
                            return(set_implicit_syntax(sc, cx));

                        default:                                         /* (set! (1 2) 3) */
                            s7_error(sc, sc->syntax_error_symbol, set_elist_3(sc, no_setter_string, caar_code, prepackaged_type_names[type(cx)]));
                    }
                    return(goto_top_no_pop);
                }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x145cb1
jmp 0x145c12
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1ac, %ecx            # imm = 0x1AC
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movzwl 0x4(%rax), %eax
movl %eax, %ecx
movq 0x48(%rsp), %rax
movq %rcx, 0x18(%rax)
movl $0x9, 0x54(%rsp)
jmp 0x145ed5
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x145d4d
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xfc80
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jne 0x145cf3
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x145d4b
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movq 0xdf246(%rip), %rsi     # 0x224f60
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xd4860(%rip), %rax     # 0x21a590
movq (%rax,%rcx,8), %rcx
callq 0xf240
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
jmp 0x145d57
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x18(%rsp)
subl $0x32, %eax
ja 0x145e75
movq 0x18(%rsp), %rax
leaq 0x9a913(%rip), %rcx     # 0x1e0690
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x18d700
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x18e010
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x18f240
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x18fa40
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x190070
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x190810
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x190f50
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x191fb0
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x1923a0
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x192660
movl %eax, 0x54(%rsp)
jmp 0x145ed5
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movq 0xdf0c4(%rip), %rsi     # 0x224f60
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xd46de(%rip), %rax     # 0x21a590
movq (%rax,%rcx,8), %rcx
callq 0xf240
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movl $0x9, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nop