// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: check_lambda_star_args
static s7_pointer check_lambda_star_args(s7_scheme *sc, s7_pointer args, s7_pointer body) /* checks closure*, macro*, and bacro* */
                {
                    s7_pointer top, v, w;
                    int32_t i;
                    bool has_defaults;

                    if (!is_list(args))
                    {
                        if (is_constant(sc, args))                                  /* (lambda* :a ...) */
                            eval_error(sc, "lambda* parameter '~S is a constant", 35, args);
                        if (is_symbol(args))
                            set_local(args);
                        return(args);
                    }

                    has_defaults = false;
                    top = args;
                    v = args;
                    for (i = 0, w = args; is_pair(w); i++, v = w, w = cdr(w))
                    {
                        s7_pointer car_w;
                        car_w = car(w);
                        if (is_pair(car_w))
                        {
                            has_defaults = true;
                            if (is_constant(sc, car(car_w)))                            /* (lambda* ((:a 1)) ...) */
                                eval_error(sc, "lambda* parameter '~A is a constant", 35, car(car_w));
                            if (symbol_is_in_arg_list(caar(w), cdr(w)))             /* (lambda* ((a 1) a) ...) */
                                eval_error(sc, "lambda* parameter '~A is used twice in the argument list", 56, car(car_w));

                            if (!is_pair(cdr(car_w)))                                  /* (lambda* ((a . 0.0)) a) */
                            {
                                if (is_null(cdr(car_w)))                               /* (lambda* ((a)) ...) */
                                    eval_error(sc, "lambda* parameter default value missing? '~A", 44, car_w);
                                eval_error(sc, "lambda* parameter is a dotted pair? '~A",39,  car_w);
                            }
                            else
                            {
                                if ((is_pair(cadr(car_w))) &&                          /* (lambda* ((a (quote . -1))) ...) */
                                        (s7_list_length(sc, cadr(car_w)) < 0))
                                    eval_error(sc, "lambda* parameter default value is improper? ~A", 47, car_w);
                            }

                            if (is_not_null(cddr(car_w)))                              /* (lambda* ((a 0.0 'hi)) a) */
                                eval_error(sc, "lambda* parameter has multiple default values? '~A", 50, car_w);

                            set_local(car(car_w));
                        }
                        else
                        {
                            if (car_w != sc->key_rest_symbol)
                            {
                                if (is_constant(sc, car_w))
                                {
                                    if (car_w == sc->key_allow_other_keys_symbol)
                                    {
                                        if (is_not_null(cdr(w)))                /* (lambda* (:allow-other-keys x) x) */
                                            eval_error(sc, ":allow-other-keys should be the last parameter: ~A", 50, args);
                                        if (w == top)
                                            eval_error(sc, ":allow-other-keys can't be the only parameter: ~A", 49, args);
                                        set_allow_other_keys(top);
                                        set_cdr(v, sc->nil);
                                    }
                                    else                                        /* (lambda* (pi) ...) */
                                        eval_error(sc, "lambda* parameter '~A is a constant", 35, car_w);
                                }
                                if (symbol_is_in_arg_list(car_w, cdr(w)))       /* (lambda* (a a) ...) or (lambda* (a . a) ...) */
                                    eval_error(sc, "lambda* parameter '~A is used twice in the argument list", 56, car_w);

                                if (!is_keyword(car_w)) set_local(car_w);
                            }
                            else
                            {
                                has_defaults = true;
                                if (!is_pair(cdr(w)))                               /* (lambda* (:rest) ...) */
                                    eval_error(sc, "lambda* :rest parameter missing? ~A", 35, w);
                                if (!is_symbol(cadr(w)))                         /* (lambda* (:rest (a 1)) ...) */
                                {
                                    if (!is_pair(cadr(w)))                          /* (lambda* (:rest 1) ...) */
                                        eval_error(sc, "lambda* :rest parameter is not a symbol? ~A", 43, w);
                                    eval_error(sc, "lambda* :rest parameter can't have a default value. ~A", 54, w);
                                }
                                else
                                {
                                    if (is_constant(sc, cadr(w)))                   /* (lambda* (a :rest x)...) where x is locally a constant */
                                        return(s7_error(sc, sc->wrong_type_arg_symbol,
                                                    set_elist_2(sc, wrap_string(sc, "can't bind an immutable object: ~S", 34), w)));
                                }
                                set_local(cadr(w));
                            }
                        }
                    }
                    if (is_not_null(w))
                    {
                        if (is_constant(sc, w))                             /* (lambda* (a . 0.0) a) or (lambda* (a . :b) a) */
                            eval_error(sc, "lambda* :rest parameter '~A is a constant", 41, w);
                        if (is_symbol(w))
                            set_local(w);
                    }
                    else
                    {
                        if ((body) && (!has_defaults) && (is_pair(args)))
                            set_has_no_defaults(body);
                    }
                    return(top);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb (%rsi), %al
movzbl %al, %ecx
leal -0x1(%rcx), %esi
cmpl $0x2, %esi
jae 0xb71c0
movq %rdx, (%rsp)
xorl %r13d, %r13d
movq %rbx, %rbp
movq %rbx, %r15
cmpb $0x1, %al
jne 0xb7258
movq 0x8(%r15), %r12
movb (%r12), %al
cmpb $0x1, %al
jne 0xb70f2
movq 0x8(%r12), %rbp
cmpb $0xa, (%rbp)
jne 0xb72b9
movq %r14, %rdi
movq %rbp, %rsi
callq 0x72bfa
testb %al, %al
jne 0xb72b9
movq 0x10(%r15), %rsi
movq %rbp, %rdi
callq 0xa2485
testb %al, %al
jne 0xb72f3
movq 0x10(%r12), %r13
cmpb $0x1, (%r13)
jne 0xb734f
movq 0x8(%r13), %rsi
cmpb $0x1, (%rsi)
jne 0xb70d9
movq %r14, %rdi
callq 0x2dada
testq %rax, %rax
js 0xb74fb
movq 0x10(%r13), %rax
movb $0x1, %r13b
cmpq 0x110(%r14), %rax
je 0xb7199
jmp 0xb739a
cmpq 0x1890(%r14), %r12
je 0xb7165
cmpb $0xa, %al
jne 0xb710e
movq %r14, %rdi
movq %r12, %rsi
callq 0x72bfa
testb %al, %al
je 0xb7144
cmpq 0x1898(%r14), %r12
jne 0xb7481
movq 0x10(%r15), %rax
cmpq 0x110(%r14), %rax
jne 0xb74be
cmpq %rbx, %r15
je 0xb7538
orb $0x2, 0x3(%rbx)
movq 0x110(%r14), %rax
movq %rax, 0x10(%rbp)
movq 0x10(%r15), %rsi
movq %r12, %rdi
callq 0xa2485
testb %al, %al
jne 0xb7444
testb $-0x80, 0x6(%r12)
movq %r12, %rbp
je 0xb7199
jmp 0xb71b1
movq 0x10(%r15), %rax
cmpb $0x1, (%rax)
jne 0xb7575
movq 0x8(%rax), %rbp
movzbl (%rbp), %eax
cmpl $0xa, %eax
jne 0xb73fe
movq %r14, %rdi
movq %rbp, %rsi
callq 0x72bfa
movb $0x1, %r13b
testb %al, %al
jne 0xb75e9
movq (%rbp), %rax
movq $-0x112201, %rcx        # imm = 0xFFEEDDFF
andq %rcx, %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%rbp)
movq %r15, %rbp
movq 0x10(%r15), %r15
movb (%r15), %al
jmp 0xb7065
cmpl $0xa, %ecx
jne 0xb71d4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x72bfa
testb %al, %al
je 0xb7240
movq 0x1918(%r14), %r15
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cf95(%rip), %rcx     # 0xe4195
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
movq 0x6e0(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %rbx, 0x8(%rax)
movq 0x6e0(%r14), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2cdc0
movq %r15, %rbx
jmp 0xb767c
movq $-0x112201, %rax        # imm = 0xFFEEDDFF
andq (%rbx), %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%rbx)
jmp 0xb767c
cmpq 0x110(%r14), %r15
je 0xb73d7
cmpb $0xa, %al
jne 0xb727c
movq %r14, %rdi
movq %r15, %rsi
callq 0x72bfa
testb %al, %al
je 0xb768e
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2d135(%rip), %rcx     # 0xe43dd
movq %rcx, 0x10(%rax)
movq $0x29, 0x8(%rax)
jmp 0xb7621
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2ced4(%rip), %rcx     # 0xe41b9
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xb732b
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cebe(%rip), %rcx     # 0xe41dd
movq %rcx, 0x10(%rax)
movq $0x38, 0x8(%rax)
movq 0x8(%r12), %rcx
movq 0x6e0(%r14), %rdx
movq %rax, 0x8(%rdx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xb766a
movslq 0x7dc(%r14), %rax
leal 0x1(%rax), %ecx
andl $0x7, %ecx
movq 0x820(%r14), %rdx
movq (%rdx,%rax,8), %rax
movq 0x1918(%r14), %rbx
cmpq 0x110(%r14), %r13
movl %ecx, 0x7dc(%r14)
je 0xb763d
leaq 0x2ceba(%rip), %rcx     # 0xe4243
movq %rcx, 0x10(%rax)
movq $0x27, 0x8(%rax)
jmp 0xb7650
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2ced5(%rip), %rcx     # 0xe429b
movq %rcx, 0x10(%rax)
movq $0x32, 0x8(%rax)
jmp 0xb7650
movq (%rsp), %rcx
testq %rcx, %rcx
sete %al
orb %r13b, %al
testb $0x1, %al
jne 0xb767c
cmpb $0x1, (%rbx)
jne 0xb767c
orb $0x2, 0x6(%rcx)
jmp 0xb767c
cmpl $0x1, %eax
jne 0xb75af
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cf50(%rip), %rcx     # 0xe4383
movq %rcx, 0x10(%rax)
movq $0x36, 0x8(%rax)
jmp 0xb7621
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd6d(%rip), %rcx     # 0xe41dd
movq %rcx, 0x10(%rax)
movq $0x38, 0x8(%rax)
jmp 0xb7650
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd0c(%rip), %rcx     # 0xe41b9
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xb7650
movq 0x1918(%r14), %r15
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cde4(%rip), %rcx     # 0xe42ce
movq %rcx, 0x10(%rax)
movq $0x32, 0x8(%rax)
jmp 0xb720c
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd44(%rip), %rcx     # 0xe426b
movq %rcx, 0x10(%rax)
movq $0x2f, 0x8(%rax)
jmp 0xb7650
movq 0x1918(%r14), %r15
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd9d(%rip), %rcx     # 0xe4301
movq %rcx, 0x10(%rax)
movq $0x31, 0x8(%rax)
jmp 0xb720c
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd92(%rip), %rcx     # 0xe4333
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xb7621
movq 0x1918(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cd7c(%rip), %rcx     # 0xe4357
movq %rcx, 0x10(%rax)
movq $0x2b, 0x8(%rax)
jmp 0xb7621
movq 0x1940(%r14), %rbx
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x2cda5(%rip), %rcx     # 0xe43ba
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e0(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %r15, 0x8(%rax)
jmp 0xb766a
leaq 0x2cbd2(%rip), %rcx     # 0xe4216
movq %rcx, 0x10(%rax)
movq $0x2c, 0x8(%rax)
movq 0x6e0(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %r12, 0x8(%rax)
movq 0x6e0(%r14), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2cdc0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $-0x112201, %rax        # imm = 0xFFEEDDFF
andq (%r15), %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%r15)
jmp 0xb767c