// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: apply_syntax
static void apply_syntax(s7_scheme *sc)                            /* -------- syntactic keyword as applicable object -------- */
                {                                                                  /* current reader-cond macro uses this via (map quote ...) */
                    s7_int len;                                                      /*    ((apply lambda '((x) (+ x 1))) 4) */
                    if (is_pair(sc->args))                                           /* this is ((pars) . body) */
                    {
                        len = s7_list_length(sc, sc->args);
                        if (len == 0)
                            eval_error_no_return(sc, sc->syntax_error_symbol, "attempt to evaluate a circular list: ~S", 39, sc->args);

                        if ((sc->safety > NO_SAFETY) &&
                                (tree_is_cyclic(sc, sc->args)))
                            s7_error(sc, sc->syntax_error_symbol,
                                    set_elist_3(sc, wrap_string(sc, "apply ~S: body is circular: ~S", 30), sc->code, sc->args));
                    }
                    else len = 0;

                    if (len < syntax_min_args(sc->code))
                        s7_error(sc, sc->wrong_number_of_args_symbol, set_elist_3(sc, not_enough_arguments_string, sc->code, sc->args));

                    if ((syntax_max_args(sc->code) < len) &&
                            (syntax_max_args(sc->code) != -1))
                        s7_error(sc, sc->wrong_number_of_args_symbol, set_elist_3(sc, too_many_arguments_string, sc->code, sc->args));

                    sc->cur_op = (opcode_t)syntax_opcode(sc->code);                  /* (apply begin '((define x 3) (+ x 2))) */
                    /* I used to have elaborate checks here for embedded circular lists, but now i think that is the caller's problem */
                    sc->code = cons(sc, sc->code, sc->args);

                    pair_set_syntax_op(sc->code, sc->cur_op);
                }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x1328e3
movq 0x80(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x31900
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x13282f
movq 0x80(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x80(%rsp), %rdi
leaq 0xbd373(%rip), %rsi     # 0x1efb6d
movl $0x27, %edx
callq 0xb880
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rdx
callq 0xb830
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x80(%rsp), %rax
cmpq $0x0, 0x6a0(%rax)
jle 0x1328e1
movq 0x80(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x2f870
testb $0x1, %al
jne 0x132864
jmp 0x1328e1
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x80(%rsp), %rdi
leaq 0xbd2f4(%rip), %rsi     # 0x1efb95
movl $0x1e, %edx
callq 0xb880
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rax
movq (%rax), %rdx
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rcx
callq 0xf240
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
jmp 0x1328ec
movq $0x0, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jge 0x132963
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rax
movq 0x1900(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rdi
movq 0xf2603(%rip), %rsi     # 0x224f38
movq 0x80(%rsp), %rax
movq (%rax), %rdx
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rcx
callq 0xf240
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x80(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rax), %rax
cmpq 0x78(%rsp), %rax
jge 0x1329e8
movq 0x80(%rsp), %rax
movq (%rax), %rax
cmpl $-0x1, 0x1c(%rax)
je 0x1329e8
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rax
movq 0x1900(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rdi
movq 0xf022e(%rip), %rsi     # 0x222be8
movq 0x80(%rsp), %rax
movq (%rax), %rdx
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rcx
callq 0xf240
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x80(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x80(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x132a51
movq 0x80(%rsp), %rdi
callq 0xc670
movq 0x80(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movw %ax, %cx
movq 0x80(%rsp), %rax
movq (%rax), %rax
movw %cx, 0x4(%rax)
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rcx
andq $-0x10000, %rcx         # imm = 0xFFFF0000
orq $0x201, %rcx            # imm = 0x201
movq 0x80(%rsp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
addq $0x88, %rsp
retq
nopl (%rax)