// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %rbx
movl $0x1000202a, %eax       # imm = 0x1000202A
leaq -0x1cc(%rsi), %rcx
cmpq $0x3, %rcx
ja 0xf146a
leaq 0x207a6(%rip), %rdx     # 0x111c00
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x1000202b, %eax       # imm = 0x1000202B
jmp 0xf14b4
cmpq $0x205, %rsi            # imm = 0x205
je 0xf1483
cmpq $0x206, %rsi            # imm = 0x206
jne 0xf14af
movl $0x1000202d, %eax       # imm = 0x1000202D
jmp 0xf14b4
movl $0x1000202c, %eax       # imm = 0x1000202C
jmp 0xf14b4
movq 0x8(%rbx), %rcx
movl $0x1000602a, %eax       # imm = 0x1000602A
cmpb $0x1c, (%rcx)
jne 0xf14b4
cmpq $0x1cf, %rsi            # imm = 0x1CF
jne 0xf14af
movq 0x8(%rbx), %rcx
movl $0x1000602b, %eax       # imm = 0x1000602B
cmpb $0x1c, (%rcx)
jne 0xf14b4
movl $0x1000202a, %eax       # imm = 0x1000202A
movq 0x90(%rbx), %rcx
leaq -0x8(%rcx), %rdx
movq %rdx, 0x90(%rbx)
movq -0x8(%rcx), %r14
movq %rax, (%r14)
movq %r14, 0x520(%rbx)
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%r14)
movq (%rbx), %rax
movq 0x10(%rax), %r15
movq %r15, 0x10(%r14)
movq 0x120(%rbx), %rax
movq %rax, 0x20(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r14)
movl $0x40000000, 0x28(%r14) # imm = 0x40000000
incq 0x240(%rbx)
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
andq $-0x2, %rsi
cmpq $0x1ce, %rsi            # imm = 0x1CE
jne 0xf154b
movq 0x8(%rbx), %rcx
cmpb $0x1c, (%rcx)
je 0xf154b
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
andq (%rax), %rcx
orq $0x400a, %rcx           # imm = 0x400A
movq %rcx, (%rax)
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
cmpb $0x1c, (%rsi)
jne 0xf1578
cmpq $0x0, 0x20(%rdx)
je 0xf1582
movq 0x8(%rsi), %r12
testq %r12, %r12
sete %al
je 0xf1582
cmpq %rdx, 0x8(%r12)
je 0xf157e
movq 0x18(%r12), %r12
jmp 0xf1562
leaq 0x10(%rdx), %rax
jmp 0xf1589
testb %al, %al
je 0xf158c
leaq 0x128(%rbx), %rax
movq (%rax), %r12
cmpb $0x20, (%r12)
jne 0xf15c2
movq 0x200(%rbx), %rax
movq 0x18e0(%rbx), %rsi
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0xcd2c
cmpb $0x1, (%rax)
jne 0xf15cf
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xadbc
jmp 0xf15d4
movq %rbx, %rdi
movq %r14, %rcx
callq 0xaaca
jmp 0xf15d4
movq %r14, 0x10(%r12)
incl 0xa88(%rbx)
jne 0xf15ec
movl $0x1, 0xa88(%rbx)
incl 0xa8c(%rbx)
movq 0x8(%r14), %rsi
movq 0x110(%rbx), %rdx
movq %rbx, %rdi
callq 0xe9007
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %rax, %rcx
callq 0xea2f3
cmpl $0x2, %eax
jne 0xf161f
movq %r15, %rdi
callq 0xd4d0e
movq 0x8(%r15), %rax
cmpb $0x1, (%rax)
jne 0xf1662
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0xf1662
movq 0x8(%rax), %rax
cmpb $0x1, (%rax)
jne 0xf1662
movq 0x8(%rax), %rcx
cmpq 0x17b0(%rbx), %rcx
jne 0xf1662
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
cmpb $0xa, (%rax)
jne 0xf1662
testb $0x4, 0x6(%rax)
je 0xf1662
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