// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: set_c_function_star_args
static s7_pointer set_c_function_star_args(s7_scheme *sc)
                {
                    int32_t i, j, n_args;
                    s7_pointer arg, par, call_args, func;
                    s7_pointer *df;

                    func = sc->code;
                    n_args = c_function_all_args(func);     /* not counting keywords, I think */
                    if (is_safe_procedure(func))
                        call_args = c_function_call_args(func);
                    else call_args = protected_make_list(sc, c_function_optional_args(func), sc->F);

                    /* assume at the start that there are no keywords */
                    for (i = 0, arg = sc->args, par = call_args; (i < n_args) && (is_pair(arg)); i++, arg = cdr(arg), par = cdr(par))
                    {
                        if (!is_keyword(car(arg)))
                            set_car(par, car(arg));
                        else
                        {
                            s7_pointer kpar, karg;
                            int32_t ki;
                            /* oops -- there are keywords, change scanners (much duplicated code...)
                             *   setting checked on the call_args here rather than parsing the parameters to use add_symbol_to_list
                             */
                            for (kpar = call_args; kpar != par; kpar = cdr(kpar))
                                set_checked(kpar);
                            for (; is_pair(kpar); kpar = cdr(kpar))
                                clear_checked(kpar);
                            df = c_function_arg_names(func);
                            for (ki = i, karg = arg, kpar = par; (ki < n_args) && (is_pair(karg)); ki++, karg = cdr(karg), kpar = cdr(kpar))
                            {
                                if (!is_keyword(car(karg)))
                                {
                                    if (is_checked(kpar))
                                        return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_3(sc, parameter_set_twice_string, car(kpar), sc->args)));
                                    set_checked(kpar);
                                    set_car(kpar, car(karg));
                                }
                                else
                                {
                                    s7_pointer p;
                                    for (j = 0, p = call_args; j < n_args; j++, p = cdr(p))
                                        if (df[j] == car(karg))
                                            break;
                                    if (j == n_args)
                                        return(s7_error(sc, sc->wrong_type_arg_symbol,
                                                    set_elist_2(sc, wrap_string(sc, "~A: not a parameter name?", 25), car(karg))));
                                    if (is_checked(p))
                                        return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_3(sc, parameter_set_twice_string, car(p), sc->args)));
                                    if (!is_pair(cdr(karg)))
                                        return(s7_error(sc, sc->error_symbol, set_elist_3(sc, value_is_missing_string, func, car(karg))));
                                    set_checked(p);
                                    karg = cdr(karg);
                                    set_car(p, car(karg));
                                }
                            }
                            if (!is_null(karg))
                                return(s7_error(sc, sc->wrong_number_of_args_symbol, set_elist_3(sc, too_many_arguments_string, func, sc->args)));
                            if (ki < n_args)
                            {
                                df = c_function_arg_defaults(func);
                                if (c_func_has_simple_defaults(func))
                                {
                                    for (ki = i, kpar = par; ki < n_args; ki++, kpar = cdr(kpar))
                                        if (!is_checked(kpar))
                                            set_car(kpar, df[ki]);
                                }
                                else
                                {
                                    for (ki = i, kpar = par; ki < n_args; ki++, kpar = cdr(kpar))
                                        if (!is_checked(kpar))
                                        {
                                            s7_pointer defval;
                                            defval = df[ki];
                                            if (is_symbol(defval))
                                                set_car(kpar, lookup_checked(sc, defval));
                                            else
                                            {
                                                if (is_pair(defval))
                                                    set_car(kpar, s7_eval(sc, defval, sc->nil));
                                                else set_car(kpar, defval);
                                            }}}}
                            return(call_args);
                        }
                    }
                    if (!is_null(arg))
                        return(s7_error(sc, sc->wrong_number_of_args_symbol, set_elist_3(sc, too_many_arguments_string, func, sc->args)));
                    if (i < n_args)
                        fill_star_defaults(sc, func, i, n_args, par);
                    return(call_args);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rbp
movq 0x28(%rbp), %r15
testb $0x20, 0x2(%rbp)
jne 0x441ea
movl 0x20(%rbp), %esi
movq 0x120(%r14), %rdx
movq %r14, %rdi
callq 0x3a029
movq %rax, %rbx
movq %rax, 0x520(%r14)
jmp 0x441f2
movq 0x8(%rbp), %rax
movq 0x60(%rax), %rbx
movq 0x10(%r14), %rax
testl %r15d, %r15d
jle 0x443e7
xorl %r12d, %r12d
movq %rbx, %r13
cmpb $0x1, (%rax)
jne 0x44231
movq 0x8(%rax), %rcx
testb $-0x80, 0x6(%rcx)
jne 0x44305
movq %rcx, 0x8(%r13)
movq 0x10(%r13), %r13
movq 0x10(%rax), %rax
incq %r12
cmpl %r12d, %r15d
jne 0x44205
jmp 0x443e7
cmpq 0x110(%r14), %rax
jne 0x443f0
movq 0x8(%rbp), %rax
movq 0x50(%rax), %rax
testb $0x4, 0x2(%rbp)
jne 0x4449c
cmpl %r15d, %r12d
jge 0x44432
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq %rax, %rbp
movq (%rbp,%r12,8), %rsi
movzbl (%rsi), %eax
cmpl $0x1, %eax
je 0x442b1
cmpl $0xa, %eax
jne 0x442c2
movq 0x8(%r14), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rsi), %rcx
cmpq %rcx, %rdx
je 0x4429a
jle 0x44295
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdx
cmpq %rdx, %rcx
jl 0x44288
cmpq %rcx, %rdx
jne 0x442da
movq 0x18(%rsi), %rcx
movq 0x10(%rcx), %rax
testq %rax, %rax
jne 0x442c5
movq %r14, %rdi
callq 0x9c492
jmp 0x442c5
movq 0x110(%r14), %rdx
movq %r14, %rdi
callq 0x37073
jmp 0x442c5
movq %rsi, %rax
movq %rax, 0x8(%r13)
incq %r12
movq 0x10(%r13), %r13
cmpq %r15, %r12
jne 0x44263
jmp 0x44432
cmpb $0x1c, (%rax)
jne 0x442fa
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x442f4
cmpq %rsi, 0x8(%rcx)
je 0x4429e
movq 0x18(%rcx), %rcx
jmp 0x442e3
movq 0x10(%rax), %rax
jmp 0x442da
movq 0x10(%rsi), %rcx
cmpb $0x20, (%rcx)
je 0x4429e
jmp 0x442a7
movq %rbx, %rcx
cmpq %r13, %rbx
je 0x44327
movq %rbx, %rcx
orb $0x40, 0x2(%rcx)
movq 0x10(%rcx), %rcx
cmpq %r13, %rcx
jne 0x44310
jmp 0x44327
andb $-0x41, 0x2(%rcx)
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
je 0x4431f
cmpl %r15d, %r12d
jge 0x443e7
movq 0x8(%rbp), %rcx
movq 0x58(%rcx), %rdx
movl %r15d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %r12d, %r8d
movq %r13, %rdi
cmpb $0x1, (%rax)
jne 0x444c4
movq 0x8(%rax), %rcx
testb $-0x80, 0x6(%rcx)
jne 0x4437b
movq (%rdi), %rcx
btl $0x16, %ecx
jb 0x44596
orq $0x400000, %rcx         # imm = 0x400000
movq %rcx, (%rdi)
movq %rdi, %r9
jmp 0x443cb
xorl %r10d, %r10d
movq %rbx, %r9
cmpq %rcx, (%rdx,%r10,8)
je 0x44398
incq %r10
movq 0x10(%r9), %r9
cmpq %r10, %rsi
jne 0x44381
jmp 0x44444
cmpl %r10d, %r15d
je 0x44444
movq (%r9), %r10
btl $0x16, %r10d
jb 0x445aa
movq 0x10(%rax), %r11
cmpb $0x1, (%r11)
jne 0x445df
orq $0x400000, %r10         # imm = 0x400000
movq %r10, (%r9)
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r9)
incl %r8d
movq 0x10(%rax), %rax
movq 0x10(%rdi), %rdi
cmpl %r15d, %r8d
jne 0x4434c
cmpq 0x110(%r14), %rax
je 0x44432
movq 0x1900(%r14), %rbx
movq 0x10ec9a(%rip), %rdx    # 0x153098
movq 0x10(%r14), %rcx
leaq 0x6e8(%r14), %rax
movq 0x6e8(%r14), %rsi
movq %rdx, 0x8(%rsi)
movq 0x10(%rsi), %rdx
movq %rbp, 0x8(%rdx)
movq 0x10(%rdx), %rdx
movq %rcx, 0x8(%rdx)
movq (%rax), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38dfa
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1940(%r14), %rbx
movq 0x820(%r14), %rcx
movslq 0x7dc(%r14), %rdx
movq (%rcx,%rdx,8), %rsi
leal 0x1(%rdx), %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%r14)
leaq 0xd3179(%rip), %rcx     # 0x1175ea
movq %rcx, 0x10(%rsi)
movq $0x19, 0x8(%rsi)
movq 0x8(%rax), %rcx
leaq 0x6e0(%r14), %rax
movq 0x6e0(%r14), %rdx
movq %rsi, 0x8(%rdx)
movq 0x6e0(%r14), %rdx
jmp 0x4441c
cmpl %r15d, %r12d
jge 0x44432
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq %rax, %rcx
movq (%rcx,%r12,8), %rax
movq %rax, 0x8(%r13)
incq %r12
movq 0x10(%r13), %r13
cmpq %r12, %r15
jne 0x444ab
jmp 0x44432
cmpq 0x110(%r14), %rax
jne 0x443f0
movq 0x8(%rbp), %rax
movq 0x50(%rax), %rcx
testb $0x4, 0x2(%rbp)
jne 0x445f2
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq %rcx, %rbp
testb $0x40, 0x2(%r13)
jne 0x4455a
movq (%rbp,%r12,8), %rsi
movzbl (%rsi), %eax
cmpl $0x1, %eax
je 0x44542
cmpl $0xa, %eax
jne 0x44553
movq 0x8(%r14), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rsi), %rcx
cmpq %rcx, %rdx
je 0x4452b
jle 0x44526
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdx
cmpq %rdx, %rcx
jl 0x44519
cmpq %rcx, %rdx
jne 0x4456b
movq 0x18(%rsi), %rcx
movq 0x10(%rcx), %rax
testq %rax, %rax
jne 0x44556
movq %r14, %rdi
callq 0x9c492
jmp 0x44556
movq 0x110(%r14), %rdx
movq %r14, %rdi
callq 0x37073
jmp 0x44556
movq %rsi, %rax
movq %rax, 0x8(%r13)
incq %r12
movq 0x10(%r13), %r13
cmpq %r15, %r12
jne 0x444ed
jmp 0x44432
cmpb $0x1c, (%rax)
jne 0x4458b
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x44585
cmpq %rsi, 0x8(%rcx)
je 0x4452f
movq 0x18(%rcx), %rcx
jmp 0x44574
movq 0x10(%rax), %rax
jmp 0x4456b
movq 0x10(%rsi), %rcx
cmpb $0x20, (%rcx)
je 0x4452f
jmp 0x44538
movq 0x1940(%r14), %rbx
movq 0x10eaec(%rip), %rdx    # 0x153090
movq 0x8(%rdi), %rsi
jmp 0x445bc
movq 0x1940(%r14), %rbx
movq 0x10ead8(%rip), %rdx    # 0x153090
movq 0x8(%r9), %rsi
movq 0x10(%r14), %rcx
leaq 0x6e8(%r14), %rax
movq 0x6e8(%r14), %rdi
movq %rdx, 0x8(%rdi)
movq 0x10(%rdi), %rdx
movq %rsi, 0x8(%rdx)
jmp 0x4441c
movq 0xea8(%r14), %rbx
movq 0x1098c3(%rip), %rdx    # 0x14deb0
jmp 0x44402
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
testb $0x40, 0x2(%r13)
jne 0x44608
movq (%rcx,%r12,8), %rax
movq %rax, 0x8(%r13)
incq %r12
movq 0x10(%r13), %r13
cmpq %r12, %r15
jne 0x445f9
jmp 0x44432