// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: make_macro
static s7_pointer make_macro(s7_scheme *sc, opcode_t op)
    {
        s7_pointer cx, mac, body;
        uint64_t typ;

        if (op == OP_DEFINE_MACRO)
            typ = T_MACRO | T_DONT_EVAL_ARGS | T_COPY_ARGS;
        else
        {
            if (op == OP_DEFINE_MACRO_STAR)
                typ = T_MACRO_STAR | T_DONT_EVAL_ARGS | T_COPY_ARGS;
            else
            {
                if (op == OP_DEFINE_BACRO)
                    typ = T_BACRO | T_DONT_EVAL_ARGS | T_COPY_ARGS;
                else
                {
                    if (op == OP_DEFINE_BACRO_STAR)
                        typ = T_BACRO_STAR | T_DONT_EVAL_ARGS | T_COPY_ARGS;
                    else
                    {
                        if ((op == OP_DEFINE_EXPANSION) && (!is_let(sc->envir)))  /* local expansions are just normal macros */
                            typ = T_MACRO | T_EXPANSION | T_DONT_EVAL_ARGS | T_COPY_ARGS;
                        else
                        {
                            if ((op == OP_DEFINE_EXPANSION_STAR) && (!is_let(sc->envir)))
                                typ = T_MACRO_STAR | T_EXPANSION | T_DONT_EVAL_ARGS | T_COPY_ARGS;
                            else typ = T_MACRO | T_DONT_EVAL_ARGS | T_COPY_ARGS;
                        }
                    }
                }
            }
        }

        new_cell_no_check(sc, mac, typ);
        sc->temp6 = mac;
        closure_set_args(mac, cdar(sc->code));
        body = cdr(sc->code);
        closure_set_body(mac, body);
        closure_set_setter(mac, sc->F);
        closure_set_let(mac, sc->envir);
        closure_set_arity(mac, CLOSURE_ARITY_NOT_SET);
        sc->capture_let_counter++;

        sc->code = caar(sc->code);
        if (((op == OP_DEFINE_EXPANSION) || (op == OP_DEFINE_EXPANSION_STAR)) &&
                (!is_let(sc->envir)))
            set_type(sc->code, T_EXPANSION | T_SYMBOL | (typeflag(sc->code) & T_UNHEAP)); /* see comment under READ_TOK */
        /* symbol? macro name has already been checked, find name in environment, and define it */
        cx = symbol_to_local_slot(sc, sc->code, sc->envir);
        if (is_slot(cx))
            slot_set_value_with_hook(cx, mac);
        else s7_make_slot(sc, sc->envir, sc->code, mac); /* was current but we've checked immutable already */

        clear_symbol_list(sc); /* tracks names local to this macro */
        if (optimize(sc, body, 1, collect_parameters(sc, closure_args(mac), sc->nil)) == OPT_OOPS)
            clear_all_optimizations(sc, body);

        if ((is_pair(car(body))) &&        /* a desperate kludge -- need something better here! */
                (is_pair(cdar(body))) &&
                (is_pair(cadar(body))) &&
                (caadar(body) == sc->quote_symbol) &&
                (is_symbol(cadr(cadar(body)))) &&
                (is_definer(cadr(cadar(body)))))
            set_is_definer(sc->code);

        sc->temp6 = sc->nil;
        return(mac);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movl $0x1000202a, %ecx       # imm = 0x1000202A
leaq -0x1cc(%rsi), %rdx
cmpq $0x3, %rdx
ja 0xe8644
leaq 0x20638(%rip), %rsi     # 0x108c6c
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl $0x1000202b, %ecx       # imm = 0x1000202B
jmp 0xe8680
cmpq $0x205, %rax            # imm = 0x205
je 0xe865b
cmpq $0x206, %rax            # imm = 0x206
jne 0xe867b
movl $0x1000202d, %ecx       # imm = 0x1000202D
jmp 0xe8680
movl $0x1000202c, %ecx       # imm = 0x1000202C
jmp 0xe8680
movq 0x8(%rbx), %rdx
movl $0x1000602a, %ecx       # imm = 0x1000602A
jmp 0xe8676
movq 0x8(%rbx), %rdx
movl $0x1000602b, %ecx       # imm = 0x1000602B
cmpb $0x1c, (%rdx)
jne 0xe8680
movl $0x1000202a, %ecx       # imm = 0x1000202A
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %r14
movq %rcx, (%r14)
movq %r14, 0x520(%rbx)
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x8(%r14)
movq (%rbx), %rcx
movq 0x10(%rcx), %r15
movq %r15, 0x10(%r14)
movq 0x120(%rbx), %rcx
movq %rcx, 0x20(%r14)
movq 0x8(%rbx), %rcx
movq %rcx, 0x18(%r14)
movl $0x40000000, 0x28(%r14) # imm = 0x40000000
incq 0x240(%rbx)
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %rdx
movq %rdx, (%rbx)
andq $-0x2, %rax
cmpq $0x1ce, %rax            # imm = 0x1CE
jne 0xe871c
cmpb $0x1c, (%rsi)
je 0xe8721
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
andq (%rdx), %rax
orq $0x400a, %rax           # imm = 0x400A
movq %rax, (%rdx)
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
cmpb $0x1c, (%rsi)
jne 0xe8748
cmpq $0x0, 0x20(%rdx)
je 0xe873f
movq 0x8(%rsi), %r12
testq %r12, %r12
je 0xe873f
cmpq %rdx, 0x8(%r12)
je 0xe874f
movq 0x18(%r12), %r12
jmp 0xe872c
leaq 0x128(%rbx), %rax
jmp 0xe874c
leaq 0x10(%rdx), %rax
movq (%rax), %r12
cmpb $0x20, (%r12)
jne 0xe8785
movq 0x200(%rbx), %rax
movq 0x18e0(%rbx), %rsi
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0xbe9a
cmpb $0x1, (%rax)
jne 0xe8792
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x9f83
jmp 0xe8797
movq %rbx, %rdi
movq %r14, %rcx
callq 0x9c87
jmp 0xe8797
movq %r14, 0x10(%r12)
incl 0xa88(%rbx)
jne 0xe87af
movl $0x1, 0xa88(%rbx)
incl 0xa8c(%rbx)
movq 0x8(%r14), %rsi
movq 0x110(%rbx), %rdx
movq %rbx, %rdi
callq 0xe0710
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %rax, %rcx
callq 0xe1a2a
cmpl $0x2, %eax
jne 0xe87e2
movq %r15, %rdi
callq 0xcc395
movq 0x8(%r15), %rax
cmpb $0x1, (%rax)
jne 0xe8825
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0xe8825
movq 0x8(%rax), %rax
cmpb $0x1, (%rax)
jne 0xe8825
movq 0x8(%rax), %rcx
cmpq 0x17b0(%rbx), %rcx
jne 0xe8825
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
cmpb $0xa, (%rax)
jne 0xe8825
testb $0x4, 0x6(%rax)
je 0xe8825
movq (%rbx), %rax
orw $0x4, 0x6(%rax)
movq 0x110(%rbx), %rax
movq %rax, 0x520(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq