// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: check_lambda_args
static s7_pointer check_lambda_args(s7_scheme *sc, s7_pointer args, int32_t *arity)
                {
                    s7_pointer x;
                    int32_t i;

                    if (!is_list(args))
                    {
                        if (is_constant(sc, args))                       /* (lambda :a ...) */
                            eval_error(sc, "lambda parameter '~S is a constant", 34, args); /* not ~A here, (lambda #\null do) for example */

                        /* we currently accept (lambda i i . i) (lambda quote i)  (lambda : : . #()) (lambda : 1 . "")
                         *   at this level, but when the lambda form is evaluated, it will trigger an error.
                         */
                        if (is_symbol(args))
                            set_local(args);

                        if (arity) (*arity) = -1;
                        return(sc->F);
                    }

                    for (i = 0, x = args; is_pair(x); i++, x = cdr(x))
                    {
                        s7_pointer car_x;
                        car_x = car(x);
                        if (is_constant(sc, car_x))                      /* (lambda (pi) pi), constant here means not a symbol */
                        {
                            if (is_pair(car_x))                          /* (lambda ((:hi . "hi") . "hi") 1) */
                                eval_error(sc, "lambda parameter '~S is a pair (perhaps you want define* or lambda*?)", 69, car_x);
                            eval_error(sc, "lambda parameter '~S is a constant", 34, car_x);
                        }
                        if (symbol_is_in_arg_list(car_x, cdr(x)))       /* (lambda (a a) ...) or (lambda (a . a) ...) */
                            eval_error(sc, "lambda parameter '~S is used twice in the parameter list", 56, car_x);
                        set_local(car_x);
                    }
                    if (is_not_null(x))
                    {
                        if (is_constant(sc, x))                         /* (lambda (a . 0.0) a) or (lambda (a . :b) a) */
                            eval_error(sc, "lambda :rest parameter '~S is a constant", 40, x);
                        i = -i - 1;
                    }

                    if (arity) (*arity) = i;
                    return(sc->F);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
movzbl %al, %ecx
leal -0x1(%rcx), %edx
cmpl $0x2, %edx
jae 0x96aca
xorl %ebp, %ebp
movq $-0x112201, %r13        # imm = 0xFFEEDDFF
cmpb $0x1, %al
jne 0x96bda
movq 0x8(%r14), %r12
movzbl (%r12), %eax
cmpl $0xa, %eax
jne 0x96b38
movq %rbx, %rdi
movq %r12, %rsi
callq 0x72bfa
testb %al, %al
jne 0x96b79
movq 0x10(%r14), %rsi
movq %r12, %rdi
callq 0xa2485
testb %al, %al
jne 0x96c3a
movq (%r12), %rax
andq %r13, %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%r12)
incl %ebp
movq 0x10(%r14), %r14
movb (%r14), %al
jmp 0x96a6d
cmpl $0xa, %ecx
jne 0x96ae2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x72bfa
testb %al, %al
je 0x96bb5
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x4cdf5(%rip), %rcx     # 0xe3902
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
jmp 0x96c8b
cmpl $0x1, %eax
jne 0x96b79
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x4cdbd(%rip), %rcx     # 0xe3925
movq %rcx, 0x10(%rax)
movq $0x45, 0x8(%rax)
jmp 0x96c71
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x4cd5e(%rip), %rcx     # 0xe3902
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
jmp 0x96c71
movq $-0x112201, %rax        # imm = 0xFFEEDDFF
andq (%r14), %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%r14)
testq %r15, %r15
je 0x96cb2
orl $-0x1, (%r15)
jmp 0x96cb2
cmpq 0x110(%rbx), %r14
je 0x96caa
cmpb $0xa, %al
jne 0x96bfe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x72bfa
testb %al, %al
je 0x96ca8
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x4cd7b(%rip), %rcx     # 0xe39a4
movq %rcx, 0x10(%rax)
movq $0x28, 0x8(%rax)
jmp 0x96b19
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x4cd06(%rip), %rcx     # 0xe396b
movq %rcx, 0x10(%rax)
movq $0x38, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r12, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2cdc0
notl %ebp
testq %r15, %r15
je 0x96cb2
movl %ebp, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq