// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
movzbl (%rsi), %eax
cmpl $0x1, %eax
je 0xe6457
cmpl $0x2, %eax
je 0xe63c9
cmpl $0xa, %eax
jne 0xe635d
movq (%r12), %rax
btl $0x18, %eax
jb 0xe635d
btq $0x30, %rax
jae 0xe6340
movq 0x8(%r14), %rdx
movq 0x18(%rdx), %rdi
movq 0x20(%r12), %rsi
movl $0x18, %ecx
cmpq %rsi, %rdi
je 0xe6331
jle 0xe6328
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %rdi
cmpq %rdi, %rsi
jl 0xe631b
cmpq %rsi, %rdi
jne 0xe68e9
movq (%r12,%rcx), %rsi
cmpb $0x20, (%rsi)
jne 0xe6340
testb $0x1, 0x3(%rsi)
jne 0xe635d
cmpb $0xa, %al
jne 0xe689a
andq $-0x11122f6, %rax       # imm = 0xFEEEDD0A
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%r12)
jmp 0xe689a
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 0x31e6c(%rip), %rcx     # 0x1181f5
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 %r12, 0x8(%rax)
movq 0x6e0(%r14), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x38dfa
movq %r15, %r12
jmp 0xe689a
xorl %eax, %eax
movq %r12, %rcx
xorl %esi, %esi
cmpq 0x110(%r14), %rcx
je 0xe681c
testb %sil, %sil
je 0xe678a
movq (%rcx), %rax
btl $0x18, %eax
jb 0xe678a
btq $0x30, %rax
jae 0xe643b
movq 0x8(%r14), %rsi
movq 0x18(%rsi), %r8
movq 0x20(%rcx), %rdi
movl $0x18, %edx
cmpq %rdi, %r8
je 0xe6428
jle 0xe641f
movq 0x10(%rsi), %rsi
movq 0x18(%rsi), %r8
cmpq %r8, %rdi
jl 0xe6412
cmpq %rdi, %r8
jne 0xe69f1
movq (%rcx,%rdx), %rdi
cmpb $0x20, (%rdi)
jne 0xe643b
testb $0x1, 0x3(%rdi)
jne 0xe678a
cmpb $0xa, %al
jne 0xe689a
andq $-0x11122f6, %rax       # imm = 0xFEEEDD0A
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%rcx)
jmp 0xe689a
movabsq $0x1000000000000, %r11  # imm = 0x1000000000000
xorl %eax, %eax
movq %r12, %rcx
movq %r12, %r10
movq %rcx, %r9
movq 0x8(%rcx), %r13
movb (%r13), %cl
cmpb $0x1, %cl
jne 0xe6510
movq 0x8(%r13), %rbp
cmpb $0xa, (%rbp)
jne 0xe68ac
movq (%rbp), %r15
btl $0x18, %r15d
jb 0xe68ac
testq %r11, %r15
je 0xe64e1
movq 0x8(%r14), %rcx
movq 0x18(%rcx), %rsi
movq 0x20(%rbp), %rdi
movl $0x18, %eax
cmpq %rdi, %rsi
je 0xe64cd
jle 0xe64c4
movq 0x10(%rcx), %rcx
movq 0x18(%rcx), %rsi
cmpq %rsi, %rdi
jl 0xe64b7
cmpq %rdi, %rsi
jne 0xe6707
movq (%rbp,%rax), %rsi
cmpb $0x20, (%rsi)
jne 0xe64e1
testb $0x1, 0x3(%rsi)
jne 0xe68ac
movq 0x10(%r9), %rax
cmpb $0x1, (%rax)
jne 0xe65d6
movq 0x8(%rax), %rcx
cmpq %rbp, %rcx
je 0xe67c4
cmpb $0x1, (%rcx)
jne 0xe650a
cmpq %rbp, 0x8(%rcx)
je 0xe67c4
movq 0x10(%rax), %rax
jmp 0xe64e5
cmpq 0x1890(%r14), %r13
je 0xe666a
cmpb $0xa, %cl
jne 0xe656f
movq (%r13), %rcx
btl $0x18, %ecx
jb 0xe656f
testq %r11, %rcx
je 0xe65a7
movq 0x8(%r14), %rsi
movq 0x18(%rsi), %r8
movq 0x20(%r13), %rdi
movl $0x18, %ecx
cmpq %rdi, %r8
je 0xe655f
jle 0xe6556
movq 0x10(%rsi), %rsi
movq 0x18(%rsi), %r8
cmpq %r8, %rdi
jl 0xe6549
cmpq %rdi, %r8
jne 0xe675d
movq (%r13,%rcx), %rdi
cmpb $0x20, (%rdi)
jne 0xe65a7
testb $0x1, 0x3(%rdi)
je 0xe65a7
cmpq 0x1898(%r14), %r13
jne 0xe6a1e
movq 0x10(%r9), %rcx
cmpq 0x110(%r14), %rcx
jne 0xe6a5b
cmpq %r12, %r9
je 0xe6a98
orb $0x2, 0x3(%r12)
movq 0x110(%r14), %rcx
movq %rcx, 0x10(%r10)
movq 0x10(%r9), %rcx
cmpb $0x1, (%rcx)
jne 0xe6643
movq 0x8(%rcx), %rsi
cmpq %r13, %rsi
je 0xe6836
cmpb $0x1, (%rsi)
jne 0xe65d0
cmpq %r13, 0x8(%rsi)
je 0xe6836
movq 0x10(%rcx), %rcx
jmp 0xe65ab
cmpq %rbp, %rax
je 0xe67c4
movq 0x10(%r13), %rbx
cmpb $0x1, (%rbx)
jne 0xe6969
movq 0x8(%rbx), %rsi
cmpb $0x1, (%rsi)
jne 0xe661a
movq %r14, %rdi
movq %r9, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
callq 0x39d0d
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %r9
testq %rax, %rax
js 0xe6ba0
movq 0x10(%rbx), %rax
cmpq 0x110(%r14), %rax
jne 0xe69b4
andq $-0x1112201, %r15       # imm = 0xFEEEDDFF
movb $0x1, %al
movabsq $0x1000000000000, %r11  # imm = 0x1000000000000
jmp 0xe66e3
cmpq %r13, %rcx
je 0xe6836
testb $-0x80, 0x6(%r13)
jne 0xe66ee
movq (%r13), %r15
movq $-0x112201, %rcx        # imm = 0xFFEEDDFF
andq %rcx, %r15
movq %r13, %rbp
jmp 0xe66e3
movq 0x10(%r9), %rax
cmpb $0x1, (%rax)
jne 0xe6b0f
movq 0x8(%rax), %rbp
movzbl (%rbp), %eax
cmpl $0xa, %eax
jne 0xe6923
movq (%rbp), %r15
btl $0x18, %r15d
jb 0xe6ad5
testq %r11, %r15
je 0xe66da
movq 0x8(%r14), %rcx
movq 0x18(%rcx), %rsi
movq 0x20(%rbp), %rdi
movl $0x18, %eax
cmpq %rdi, %rsi
je 0xe66c6
jle 0xe66c1
movq 0x10(%rcx), %rcx
movq 0x18(%rcx), %rsi
cmpq %rsi, %rdi
jl 0xe66b4
cmpq %rdi, %rsi
jne 0xe6734
movq (%rbp,%rax), %rsi
cmpb $0x20, (%rsi)
jne 0xe66da
testb $0x1, 0x3(%rsi)
jne 0xe6ad5
andq $-0x1112201, %r15       # imm = 0xFEEEDDFF
movb $0x1, %al
orq $0x100000, %r15         # imm = 0x100000
movq %r15, (%rbp)
movq 0x10(%r9), %rcx
movb (%rcx), %sil
movq %r9, %r10
cmpb $0x1, %sil
je 0xe6469
jmp 0xe6916
movl $0x10, %eax
cmpb $0x1c, (%rcx)
jne 0xe64cd
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0xe672e
cmpq %rbp, 0x8(%rsi)
je 0xe64d2
movq 0x18(%rsi), %rsi
jmp 0xe6719
movq 0x10(%rcx), %rcx
jmp 0xe670c
movl $0x10, %eax
cmpb $0x1c, (%rcx)
jne 0xe66c6
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0xe6757
cmpq %rbp, 0x8(%rsi)
je 0xe66cb
movq 0x18(%rsi), %rsi
jmp 0xe6742
movq 0x10(%rcx), %rcx
jmp 0xe6739
movl $0x10, %ecx
cmpb $0x1c, (%rsi)
jne 0xe655f
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0xe6784
cmpq %r13, 0x8(%rdi)
je 0xe6564
movq 0x18(%rdi), %rdi
jmp 0xe676f
movq 0x10(%rsi), %rsi
jmp 0xe6762
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rdx
movq (%rax,%rdx,8), %rax
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%r14)
leaq 0x31c87(%rip), %rdx     # 0x11843d
movq %rdx, 0x10(%rax)
movq $0x29, 0x8(%rax)
jmp 0xe6800
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31a4d(%rip), %rcx     # 0x11823d
movq %rcx, 0x10(%rax)
movq $0x38, 0x8(%rax)
movq 0x8(%r13), %rcx
movq 0x6e0(%r14), %rdx
movq %rax, 0x8(%rdx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xe6888
testq %rdx, %rdx
sete %cl
orb %al, %cl
testb $0x1, %cl
jne 0xe689a
cmpb $0x1, (%r12)
jne 0xe689a
orb $0x2, 0x6(%rdx)
jmp 0xe689a
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x319db(%rip), %rcx     # 0x11823d
movq %rcx, 0x10(%rax)
movq $0x38, 0x8(%rax)
movq 0x6e0(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %r13, 0x8(%rax)
movq 0x6e0(%r14), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x38dfa
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31941(%rip), %rcx     # 0x118219
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xe67fc
movl $0x10, %ecx
cmpb $0x1c, (%rdx)
jne 0xe6331
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
je 0xe6910
cmpq %r12, 0x8(%rsi)
je 0xe6335
movq 0x18(%rsi), %rsi
jmp 0xe68fb
movq 0x10(%rdx), %rdx
jmp 0xe68ee
cmpb $0xa, %sil
sete %sil
jmp 0xe63d0
cmpl $0x1, %eax
jne 0xe6b49
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31a8b(%rip), %rcx     # 0x1183e3
movq %rcx, 0x10(%rax)
movq $0x36, 0x8(%rax)
jmp 0xe6b81
movslq 0x7dc(%r14), %rax
leal 0x1(%rax), %ecx
andl $0x7, %ecx
movq 0x820(%r14), %rdx
movq (%rdx,%rax,8), %rax
movq 0x1918(%r14), %r12
cmpq 0x110(%r14), %rbx
movl %ecx, 0x7dc(%r14)
je 0xe6bdd
leaq 0x31900(%rip), %rcx     # 0x1182a3
movq %rcx, 0x10(%rax)
movq $0x27, 0x8(%rax)
jmp 0xe686e
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x3191b(%rip), %rcx     # 0x1182fb
movq %rcx, 0x10(%rax)
movq $0x32, 0x8(%rax)
jmp 0xe686e
movl $0x10, %edx
cmpb $0x1c, (%rsi)
jne 0xe6428
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0xe6a18
cmpq %rcx, 0x8(%rdi)
je 0xe642c
movq 0x18(%rdi), %rdi
jmp 0xe6a03
movq 0x10(%rsi), %rsi
jmp 0xe69f6
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x317cf(%rip), %rcx     # 0x118219
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xe686e
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 0x318a7(%rip), %rcx     # 0x11832e
movq %rcx, 0x10(%rax)
movq $0x32, 0x8(%rax)
jmp 0xe6395
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 0x3189d(%rip), %rcx     # 0x118361
movq %rcx, 0x10(%rax)
movq $0x31, 0x8(%rax)
jmp 0xe6395
movq 0x1940(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31919(%rip), %rcx     # 0x11841a
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
jmp 0xe6b81
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31858(%rip), %rcx     # 0x118393
movq %rcx, 0x10(%rax)
movq $0x23, 0x8(%rax)
jmp 0xe6b81
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x31842(%rip), %rcx     # 0x1183b7
movq %rcx, 0x10(%rax)
movq $0x2b, 0x8(%rax)
movq 0x6e0(%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%r14), %rax
movq 0x10(%rax), %rax
movq %r9, 0x8(%rax)
jmp 0xe6888
movq 0x1918(%r14), %r12
movq 0x820(%r14), %rax
movslq 0x7dc(%r14), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0x316ff(%rip), %rcx     # 0x1182cb
movq %rcx, 0x10(%rax)
movq $0x2f, 0x8(%rax)
jmp 0xe686e
leaq 0x31692(%rip), %rcx     # 0x118276
movq %rcx, 0x10(%rax)
movq $0x2c, 0x8(%rax)
jmp 0xe686e